Let $G$ be a compact connected Lie group and $n\geqslant 1$ an integer. Consider the space of ordered commuting $n$-tuples in $G$, ${\operatorname {\textrm {Hom}}}({\mathbb {Z}}^n,G)$, and its quotient under the adjoint action, $\textrm {Rep}({\mathbb {Z}}^n,G):={\operatorname {\textrm {Hom}}}({\mathbb {Z}}^n,G)/G$. In this article, we study and in many cases compute the homotopy groups $\pi _2({\operatorname {\textrm {Hom}}}({\mathbb {Z}}^n,G))$. For $G$ simply connected and simple, we show that $\pi _2({\operatorname {\textrm {Hom}}}({\mathbb {Z}}^2,G))\cong {\mathbb {Z}}$ and $\pi _2(\textrm {Rep}({\mathbb {Z}}^2,G))\cong {\mathbb {Z}}$ and that on these groups the quotient map ${\operatorname {\textrm {Hom}}}({\mathbb {Z}}^2,G)\to \textrm {Rep}({\mathbb {Z}}^2,G)$ induces multiplication by the Dynkin index of $G$. More generally, we show that if $G$ is simple and ${\operatorname {\textrm {Hom}}}({\mathbb {Z}}^2,G)_{\mathds 1}\subseteq {\operatorname {\textrm {Hom}}}({\mathbb {Z}}^2,G)$ is the path component of the trivial homomorphism, then $H_2({\operatorname {\textrm {Hom}}}({\mathbb {Z}}^2,G)_{\mathds 1};{\mathbb {Z}})$ is an extension of the Schur multiplier of $\pi _1(G)^2$ by ${\mathbb {Z}}$. We apply our computations to prove that if $B_{com}G_{\mathds 1}$ is the classifying space for commutativity at the identity component, then $\pi _4(B_{com}G_{\mathds 1})\cong {\mathbb {Z}}\oplus {\mathbb {Z}}$, and we construct examples of non-trivial transitionally commutative structures on the trivial principal $G$-bundle over the sphere ${\mathbb {S}}^{4}$.