Using Van Kampen's Theorem to determine fundamental group

I'm trying to calculate the fundamental group of a surface using (i) deformation retracts and (ii) Van Kampen's Theorem. I'm really struggling understanding the group theory behind it and the interactions behind the different fundamental groups involved ($$\pi(U), \pi(V),$$ and $$\pi(U\cap V)$$). I would really appreciate it if someone could help me understand this.

I am trying to calculate the fundamental group of the following figure:

The deformation retract of this figure is shown below. Using Van Kampen's Theorem then, I choose $$U$$ to be the open region consisting of one triangle and a portion of the line segment connecting the two (the green region in the figure below), and similarly for $$V$$ (the red region in the figure below).

$$\pi(U\cap V)$$ is trivial, as $$U \cap V$$ may be deformed to a point which has a trivial fundamental group. For $$U$$ and $$V$$, either of these may be continuously deformed to a shape with fundamental group isomorphic to the integers, or the free group on $$1$$ generator. It's not particularly clear to me how this helps us find $$\pi(X)$$, and how the relations on each fundamental group can be translated to relations on $$\pi(X)$$.

So, $$\pi_1(U)$$ is generated by one element say $$a$$ and $$\pi_1(V)$$ is generated by the element $$b$$, now since $$\pi_1(U\cap V)=0$$ this means there are no more relations between $$a$$,$$b$$. So the group that you get for $$\pi_1(U\cup V)$$ is just the group generated by $$(a,b)$$ with no relations, i.e. the free group generated by two elements $$\mathbb{Z}*\mathbb{Z}$$.