One obvious but important observation is that, for operators on a $n$-dimensional vector space over a field, if $1 < n < \infty$, we have $AB \neq BA$ generically. In other words, consider the commutativity locus $\mathcal{C}_n$ of all pairs of $n \times n$ matrices $A,B$ such that $AB = BA$ as a subset of $\mathbb{A}^{n^2}$. This is clearly a Zariski closed set -- i.e., defined by the vanshing of polynomial equations. It is also proper: take e.g. $A = \left[ \begin{array}{cc} 1 & 1 \\ 0 & 1 \end{array} \right] \oplus 0_{n-2}$ and $B = \left[ \begin{array}{cc} 0 & 1 \\ 0 & 1 \end{array} \right] \oplus 0_{n-2}$. Since $\mathbb{A}^{n^2}$ is an irreducible variety, $\mathcal{C}_N$ therefore has dimension less than $N^2$. This implies that over a field like $\mathbb{R}$ or $\mathbb{C}$ where such things make sense, $\mathbb{C}$ \mathcal{C}_N$has measure zero, thus giving a precise meaning to the idea that two matrices, taken at random, will not commute. One could ask for more information about the subvariety$\mathcal{C}_N$: what is its dimension? is it irreducible? and so forth. (Surely someone here knows the answers.) I would guess it is also true that for a Banach space$E$(over any locally compact, nondiscrete field$k$, say) of dimension$> 1$, the locus$\mathcal{C}_E$of all commuting pairs of bounded linear operators is meager (in the sense of Baire category) in the space$B(E,E) \times B(E,E)$of all pairs of bounded linear operators on$E$. Kevin Buzzard has enunciated a principle that without further constraints, the optimal answer to a question "What is a necessary and sufficient condition for$X$to hold?" is simply "X". This seems quite applicable here: I don't think you'll find a necessary and sufficient condition for two linear operators to commute which is nearly as simple and transparent as the beautiful identity$AB = BA$. Still, you could ask for useful sufficient conditions. Diagonalizable operators with the same eigenspaces, as mentioned by Jonas Meyer above, is one. Another is that if$A$and$B$are both polynomials in the same operator$C$: this shows up for instance in the Jordan decomposition. 1 One obvious but important observation is that, for operators on a$n$-dimensional vector space over a field, if$1 < n < \infty$, we have$AB \neq BA$generically. In other words, consider the commutativity locus$\mathcal{C}_n$of all pairs of$n \times n$matrices$A,B$such that$AB = BA$as a subset of$\mathbb{A}^{n^2}$. This is clearly a Zariski closed set -- i.e., defined by the vanshing of polynomial equations. It is also proper: take e.g. $A = \left[ \begin{array}{cc} 1 & 1 \\ 0 & 1 \end{array} \right] \oplus 0_{n-2}$ and $B = \left[ \begin{array}{cc} 0 & 1 \\ 0 & 1 \end{array} \right] \oplus 0_{n-2}$. Since$\mathbb{A}^{n^2}$is an irreducible variety,$\mathcal{C}_N$therefore has dimension less than$N^2$. This implies that over a field like$\mathbb{R}$or$\mathbb{C}$where such things make sense,$\mathbb{C}$has measure zero, thus giving a precise meaning to the idea that two matrices, taken at random, will not commute. One could ask for more information about the subvariety$\mathcal{C}_N$: what is its dimension? is it irreducible? and so forth. (Surely someone here knows the answers.) I would guess it is also true that for a Banach space$E$(over any locally compact, nondiscrete field$k$, say) of dimension$> 1$, the locus$\mathcal{C}_E$of all commuting pairs of bounded linear operators is meager (in the sense of Baire category) in the space$B(E,E) \times B(E,E)$of all pairs of bounded linear operators on$E$. Kevin Buzzard has enunciated a principle that without further constraints, the optimal answer to a question "What is a necessary and sufficient condition for$X$to hold?" is simply "X". This seems quite applicable here: I don't think you'll find a necessary and sufficient condition for two linear operators to commute which is nearly as simple and transparent as the beautiful identity$AB = BA$. Still, you could ask for useful sufficient conditions. Diagonalizable operators with the same eigenspaces, as mentioned by Jonas Meyer above, is one. Another is that if$A$and$B$are both polynomials in the same operator$C\$: this shows up for instance in the Jordan decomposition.