Union of Two Solid Tori I see that the 3-sphere $S^3$ can be thought of as $\partial D^4 \cong \partial(D^2 \times D^2) = (\partial D^2 \times D^2) \,\cup\, (D^2 \times \partial D^2)$, but I am confused to what the actual union means. Does it mean glue their boundaries together? 
 A: The boundary of a solid torus is the regular hollow torus. So if you have $2$ solid tori, you can pick an isomorphism that maps the boundary of one to the boundary of the other. This is your glueing map. Note that the isomorphisms fall into two topologically distinct classes. One glues the two solid tori to $S^3$, the other one gives $S^2 \times S^1$. 
A: Your equation $\partial (D^2 \times D^2) = (\partial D^2 \times D^2) \,\cup\, (D^2 \times \partial D^2) = (S^1 \times D^2) \cup (D^2 \times S^1)$ does not mean that anything is glued. $\partial (D^2 \times D^2)$ is the union of two genuine subspaces $\Theta_ 1 = S^1 \times D^2$ and $\Theta_ 2 = D^2 \times S^1$ of $\partial (D^2 \times D^2)$ intersecting in $T  = (S^1 \times D^2) \,\cap\, (D^2 \times S^1) = S^1 \times S^1$ which is a torus lying in $\partial (D^2 \times D^2) \subset D^2 \times D^2 \subset \mathbb R^4$.
However, it shows that $S^3$ is homeomorphic to the quotient space obtained from the disjoint union ot two solid tori by gluing their boundaries via a suitable homeomorphism. To see this, let $$Q = (\Theta_1 \times \{1\} \cup  \Theta_2 \times \{2\} )/ \sim$$
where $\sim$ is generated by $(x,1) \sim (x,2)$ for $x \in T$. We can also write it as the adjunction space
$$Q = \Theta_1 \cup_i  \Theta_2$$
obtained by attaching $\Theta_1$ to $\Theta_2$ via the inclusion $i : T \hookrightarrow \Theta_2$.
The map
$$p : \Theta_1 \times \{1\} \cup  \Theta_2 \times \{2\} \to \partial (D^2 \times D^2), p(x,i) = x ,$$
is a quotient map whose fibers are singletons for $x \notin T$ and  $\{ (x,1), (x,2) \}$ for $x \in T$. Hence $p$ induces a homeomorphism $Q \to \partial (D^2 \times D^2)$.
Remark: The result of the gluing process depends on the choice of a homeomorphism $h : T \to T$ which induces an attaching map $i_h = i \circ h : T \to \Theta_2$. Our above attaching map is obtained for $h = id$. See Moishe Kohan's comment.
