I am new in Alebraic Topology. Given the torus, we say that the fundamental group of the torus is generated by two loops (or more exactly two equivalent classes of loops). One writes $\pi=\mathbb{Z}\times\mathbb{Z}.$
I don't understand, how the null-homotopic loop, which is the constant loop, is generated by the two generators mentioned above. Can somebody provide an explanation? More even so, I don't see how it functions visually, since the two generators are not null-homotopic. More precisely, given a null-homotopic loop on the surface on a base point $x$, how this loop will be generated by the two generators mentioned above?
Let $\mathbb{T}^2$ denote the torus and choose a basepoint $p \in \mathbb{T}^2$. Then we know that $\pi_1\left(\mathbb{T}^2, p \right) \cong \mathbb{Z} \times \mathbb{Z}$.
Now I think the reason for your confusion is an algebraic one.
Recall that $\mathbb{Z} \times \mathbb{Z}$ has two generators, $a= (1, 0)$ and $b =(0, 1)$. Choose an isomorphism $\psi : \pi_1\left(\mathbb{T}^2, p \right) \to \mathbb{Z} \times \mathbb{Z}$, by surjectivity there exists path classes, $[f], [g] \in \pi_1\left(\mathbb{T}^2, p \right)$ such that $\psi([f]) = a$ and $\psi([g]) =b$. Then since $\psi$ is an isomorphism we have $[f]$ and $[g]$ to be the two generators of $\pi_1\left(\mathbb{T}^2, p \right)$.
Now your question is how the path class of the constant loop $c_p : I \to \mathbb{T}^2$ defined by $c_p(x) = p$ for all $x \in I$, that being $[c_p] \in \pi_1\left(\mathbb{T}^2, p \right)$ is generated by $[f]$ and $[g]$. Well the answer to that is simple: note that $$[c_p] = 1_{\pi_1\left(\mathbb{T}^2, p \right)}$$ that is $[c_p]$ is the identity element of $\pi_1\left(\mathbb{T}^2, p \right)$. Then recall the following definition that we have for exponents in groups.
Hence since $[f], [g] \in \pi_1\left(\mathbb{T}^2, p \right)$ and $\pi_1\left(\mathbb{T}^2, p \right)$ is indeed a group, we have $$[f]^0 = [g]^0 = 1_{\pi_1\left(\mathbb{T}^2, p \right)}.$$
Then we have $$\left[c_p\right] = [f]^0 * [g]^0$$ and so the constant path at $p$ is indeed generated by the two generators of $\pi_1\left(\mathbb{T}^2, p \right)$. And since $[c_p]$ is a nullhomotopic loop, since it is a constant loop by definition, the above shows how a product of two non null-homotopic loops yield a null-homotopic loop.
Note that above even though I've gone into quite a bit of detail, the only real fact I'm using is the following algebraic one. If we have a group $G$ and we have $G = \langle A \rangle$ for some subset $A \subseteq G$ then every element $x \in G$ can be written as $x = g_1 \dots g_n \cdot h_1^{-1} \dots h_m^{-1}$ where $g_i, h_i \in G$. In particular if we have $G = \langle c , d \rangle$, that is $G$ is generated by the two elements $c$ and $d$ then we can express $1_G$ as $1_G = c^0 \cdot d^0$.