Given two categories $I$ and $J$ we say that colimits of shape $I$ commute with limits of shape $J$ in the category of sets, if for any functor $F : I \times J \to \text{Set}$ the canonical map $$\textrm{colim}_{i\in I} \text{lim}_{j\in J} F(i,j) \to \textrm{lim}_{j\in J} \text{colim}_{i\in I} F(i,j)$$ is an isomorphism.
The standard examples are a) filtered colimits commute with finite limits and b) sifted colimits commute with finite products. (Those statements can be regarded as definitions of which categories $I$ are filtered or sifted respectively, but both terms have independent definitions for which these commutation results are propositions.) A third, less known example is to take $I$ a finite group and $J$ a cofiltered category, in other words, if $G$ is a finite group and $X_j$ is an inverse system of $G$-sets, then the canonical map $$(\varprojlim_{j\in J} X_j)/G \to \varprojlim_{j \in J}(X_j/G)$$ is an isomorphism.
Now, all of these examples are easy to prove separately (here's a proof of the $G$-set result, for example) but I see no unifying pattern. Is there a simple criterion for when $I$-colimits and $J$-colimits commute in the category of sets?
[Note: It's true that $I$ is filtered (resp. sifted) if and only if for all finite (resp. finite discrete) $J$ the diagonal functor $I \to I^J$ is final; but I don't think that for arbitrary $I$ and $J$, if the diagonal $I \to I^J$ is final then $I$-colimits commute with $J$-limits. If I'm wrong and that condition on the diagonal actually is sufficient for commutation: why? and is it also necessary?]