  Let $\mathrm{Hom}(\mathbb{Z}^m,G)$ denote the space of commuting $m$-tuples
in a Lie group $G$. In this paper, we study torsion in the homology of
$\mathrm{Hom}(\mathbb{Z}^m,G)$. We describe $\mathrm{Hom}(\mathbb{Z}^m,G)$ as a
homotopy colimit of a functor $F_m$ defined by homogeneous spaces of $G$, and
then by analyzing the functor $F_m$, we develop a method for detecting torsion
in the homology of $\mathrm{Hom}(\mathbb{Z}^m,G)$ in terms of the extended
Dynkin diagram of $G$. Using this method, we prove that for $m\ge 2$,
$\mathrm{Hom}(\mathbb{Z}^m,\mathrm{SU}(n))$ has $p$ torsion in homology if and
only if $p\le n$. We also compute some torsion in the homology of
$\mathrm{Hom}(\mathbb{Z}^m,G)$ for $G=\mathrm{Spin}(2n)$ or exceptional. As an
another application of the method, we determine the top homology of
$\mathrm{Hom}(\mathbb{Z}^m,G)$ for any compact simply-connected simple Lie
group $G$.
