Relative homology groups of the torus
$(X,A)$ and $(X,B)$ are good pairs (because $X$ is a cell complex and $A$ and $B$ are subcomplexes).
Now you can use proposition 2.22. on page 124 which states that $H_n(X,A) \cong \tilde{H_n}(X/A)$.
In your case you have $X/A = T^2 \vee T^2$ and $X/B = T^2 \vee S^1$. So you want to compute the reduced homology of a wedge sum. By corollary 2.25. on page 126 you know that $\tilde{H_n} (\bigvee_\alpha X_\alpha) = \bigoplus_\alpha \tilde{H_n}(X_\alpha)$ so the answer to the question boils down to computing the reduced homology groups of $T^2$ and $S^1$ respectively.
Hope this helps. Otherwise don't hesitate to ask.
As for your question: It would be nice of you if you could edit it and include the question from Hatcher. Would you do that? Thank you in advance.
For the case $H(X,A)$: just plug in the exact sequence the things you know:
$0 \to \mathbb{Z} \to H_2(X,A) \to \mathbb{Z} =H_1(A)\to H_1(X)= \mathbb{Z}^4 \to H_1(X,A)\to 0$
As you said, the map $\mathbb{Z} =H_1(A)\to H_1(X)= \mathbb{Z}^4$ is the zero map since $A$ bounds a subsurface in $X$; thus you can split your sequence in two easier pieces:
$ 0 \to \mathbb{Z} \to H_2(X,A) \to \mathbb{Z} =H_1(A)\to 0$
$0 \to H_1(X)= \mathbb{Z}^4\to H_1(X,A)\to 0$
But these are exact sequences! so you obtain respectively
$H_2(X,A) / \mathbb{Z} = H_1(A)$, which implies $H_2(X,A)=\mathbb{Z} ^2$
$H_1(X,A)=\mathbb{Z}^4$
Now take the case (X,B) and plug in what you know
$0 \to \mathbb{Z} \to H_2(X,B) \to \mathbb{Z} =H_1(B)\to H_1(X)= \mathbb{Z}^4 \to H_1(X,B)\to 0$
Now $B$ is not nullhomologous and so the map $H_1(B) \to H_1(X)$ is injective; therefore, you can split like this:
$0 \to \mathbb{Z} \to H_2(X,B) \to 0$ which implies $H_2(X,B)=\mathbb{Z}$
$0\to \mathbb{Z} \to \mathbb{Z}^4 \to H_1(X,b)$ which implies $ H_1(X,B) = \mathbb{Z}^4 / \mathbb{Z} = \mathbb{Z}^3 $
Notice that:
1) this is consistent with Matt's answer, but is more basic: you don't need to find any retract of $X/A$ or $X/B$ and you don't need the result on wedge sums, just some reasoning on injective maps between powers of $\mathbb{Z}$.
2) this generalizes to a surface of arbitrary genus $g$ (you will have $2g$ instead of $4$, but the proof is exactly the same).
Let me know if something was not clear.
(I don't have enough reputation so can't reply to the comment of @man_in_green_shirt above.)
In @Lor's answer above, there should be a zero on the right hand side of, $$ 0 \rightarrow H_1(X) \rightarrow H_1(X,A) \rightarrow 0 $$ but not because $H_0(A) = 0$.
All elements $[\alpha] \in H_1(X,A)$ get sent to the homology class in $H_0(A)$ corresponding to $\partial \alpha \in C_0(A)$. But then observe that any such $\partial \alpha \in C_0(A)$ is actually bounding a contiguous region of $A$. Then any such $\partial \alpha$ is a boundary in $C_0(A)$, and thus $\partial \alpha$ is null homologous in $H_0(A)$.
Notice that this would not be true if, for example, $A$ was not the circle shown but was instead two disjoint arcs of the circle.