Remark. We'll give the same name to curves/loops, singular $1-$simplexes, and their image, for example $a$ can represent a curve $[0,1]\to X$, or a simplex $\Delta^1\to X$, or the image $a([0,1])$. The meaning will be taken from the context.
Now, take $a=S^1\times 1$ and $b=1\times S^1$. Then $A=a\cup b=a\vee b\cong S^1\vee S^1$. Furthermore, $T/A\cong S^2$. So, since $A$ is a deformation retract of the torus when removing a disk from it, we get the long exact sequence
$$\cdots \to \tilde{H}_n(A)\to \tilde{H}_n(T)\to \tilde{H}_n(S^2)\to \tilde{H}_{n-1}(A)\to\cdots$$
When $n>2$ we have $\tilde{H}_n(A)=\tilde{H}_n(S^2)=0$ so the exact sequence becomes
$$\cdots \to 0\to \tilde{H}_n(T)\to 0\to\cdots$$
so $H_n(T)=0$ for $n>2$. Since $T$ is path-connected then $H_0(T)=\bZ$.
Also, around $n=1$ we have
$$0\to H_2(T)\hookrightarrow \bZ\to \bZ\oplus \bZ\rightarrowtail H_1(T)\to 0$$ where $\hookrightarrow$ denotes a monomorphism and $\rightarrowtail$ denotes an epimorphism.
So, in the sequence $\ker(\bZ\to \bZ\oplus \bZ)=\im(H_2(T)\hookrightarrow \bZ)\cong H_2(T)$ and
$\coker(\bZ\to \bZ\oplus \bZ)\cong H_1(T)$. If we can prove $\bZ\to \bZ\oplus \bZ$ is $0$ we'll get $H_2(T)\cong\bZ$ and $H_1(T)\cong \bZ\oplus \bZ$. But this is the boundary morphism, so if $[\alpha]\in H_2(T,A)\cong H_2(T/A),$ then $\partial[\alpha]=[\partial \alpha]$ where the left class is in $H_2(T,A)$ and the right one in $H_1(A)$.
We'll look for a generator of $H_2(T,A)$ and then see it's mapped into $0$. To do this, we'll consider the following isomorphisms
$$H_2(T,A)\cong H_2(T,S)\cong H_2(N,S^1)\cong_{\partial}H_1(S^1)$$
where $S\cup N$ is $T$ and $S\cap N\simeq S^1$ (As in the picture)
which are really isomorphisms: The first one since $A$ is a deform-retraction of $S$, the second one by Excision Theorem: $H_2(T,S)\cong H_2(N,N\cap S)$. The third one by the exact sequence of the pair $(N,S^1)$. Now, take a generator $[g]\in H_1(S^1)$. There is a singular $2-$simplex $\Delta$ sent into $-[g]$ by $\partial$, which is described by the following picture:
This is, take the standard $2-$simplex, subdivide it as it shows, and then identify all the vertices, send $[1,3]$ into $g$, and collapse all which is not red in a point.
It's boundary is clearly $-g$. So $[\Delta]$ is a generator of $H_2(N,S^1)$, which, by the inclusion $(N,S^1)\hookrightarrow (T,S)$ is a generator of $H_2(T,S)$, which deforms to the generator of $H_2(T,A)$:
whose boundary in $A$ is just $-([a]-[b]-[a]+[b])=0$ (It's a commutator in $\pi_1(S^1\vee S^1)$). So, indeed, $\bZ\to \bZ\oplus\bZ$ is just the zero morphism. The process and result is the same when replacing $\bZ$ for any coefficient group $R$. For the surface $M_g$ of genus $g$ it's very similar. With the same notations, $A\cong \bigvee_{i=1}^g S^1$ and $M_g/A\cong S^2$. $H_n(M_g)=0$ for $n>2$ and around $n=1$ we have the exact sequence:
$$0\to H_2(M_g)\hookrightarrow \bZ\to \bigoplus_{i=1}^g \bZ \rightarrowtail H_1(T)\to 0,$$
in which the morphism $\bZ\to \bigoplus_{i=1}^g \bZ$ is still zero: the generator of $H_2(M_g,A)$ is sent into the image of a product of commutators in $\pi_1(A)$, which is zero in $H_1(A)$. So $H_2(M_g)=\bZ$ and $H_1(M_g)=\bZ^g$.
The case of the projective plane $P=\bR P^2$ it's similar, but now the space is the following one:
Thus $A$ is just $S^1$ instead of $S^1\vee S^1$. This changes the exact sequence when $n\leq 2$. It still holds that $P/A\cong S^2$. So, the sequence
$$\cdots \to \tilde{H}_n(A)\to \tilde{H}_n(P)\to \tilde{H}_n(S^2)\to \tilde{H}_{n-1}(A)\to\cdots$$
becomes, around $n=1$,
$$0\to \tilde{H}_2(P)\to \tilde{H}_2(S^2)\to \tilde{H}_{1}(S^1)\to \tilde{H}_1(P)\to 0$$
which is
$$0\to H_2(P)\to \bZ\to \bZ\to H_1(P)\to 0.$$
As before, the homomorphism in the fragment $\bZ\to\bZ$ will determine the homology groups.
The same way as before, the generator of $H_2(P,A)$ is just the singular simplex:
and it's boundary is $2[a]$, so $\bZ\to \bZ$ is just multiplication by $2$. From $\ker (\bZ\to \bZ)=0$ we can extract an exact triple $0\to H_2(P)\to 0$ so $H_2(P)=0$. Also $H_1(P)\cong \coker (\bZ\to \bZ)=\bZ/2\bZ$.
Of course, using cellular homology all these calculations become too easy and the homology groups can be easily computed even for more complex spaces, like all the projective spaces.










