As for the original question, $[\mathbb T^2,X]$ is just $\{(a,b,s)\in\pi_1(X)^2\times\pi_2(X)|ab=ba\}$ for pointed maps and $H_1(X)^2\times\pi_2(X)$ for non-pointed maps.
Indeed, parallel and meridian of $\mathbb T^2$ maps to a pair of elements of $\pi_1(X)$ and the 2-cell of the torus maps to a null-homotopy of $aba^{-1}b^{-1}$, but homotopies between trivial loop and some other null-homotopic loop can be identified with $\pi_2(X)$.
/*
Moreover, this element of $\pi_2$ is well-defined: if we move $a$ by some homotopy $t$ (that can be again identified with an element of $\pi_2$), we get $s'=s+t-t$.
Cf. $[\mathbb RP^2,X]$ which gives an element of $\pi_2(X)$ well-defined only up to transforms $s'=s+2t$, i.e. only mod 2.
Actually, this kind of elementary obstruction theory (cf.) shows that for any 2-dimensional CW-complex $S$ the set of homotopy classes $[S,X]$ is in bijection with $H^1(S;\pi_1(X))\times H^2(S;\pi_2(X))$. (But in higher dimensions the situation becomes more complicated.)
*/
In particular, if $\pi_1(X)=0$, $[\mathbb T^2,X]=\pi_2(X)=H_2(X)$.