(Full disclosure, there is a *much* easier way to do this problem, namely finding a nice space homotopy equivalent to X.)
Okay, so what is Mayer-Vietoris doing for us then?
We'll also simplify further by taking "reduced" homology -- why is this a good thing to do?
However, we can use some ad-hoc reasoning: it's a theorem that H_0 X is one copy of Z for each path component of X. We can argue that X is path-connected, and so H_0 X = Z.
For us, that means H_2 X ≅ (ZxZ)xZ = Z^3.
H_* X = [Z, 0, 0, Z^3, 0, 0, ....]
i.e. Z in degree 0, Z^3 in degree 2, and zero elsewhere!
This gives the solution, but it's a bit unsatisfying: where did we use the fact that the gluing map was degree 2?
We skate by because too many zeros appeared!
1. Can you construct a space that *forces* considering degrees of attaching maps in MV?
(Try the Klein bottle!)
2. Can you modify X to make H_1 X and/or H_1 A ⊕ H_1 B nontrivial?
Does it also help explain why the degree of the map didn't play a role here?