I am interested in the second line of the following:
I did not understand why it is a union. But I think I just realized now. In the initial probability $ P\left( X>a,Y>b \right) \equiv P \left( X \in (a,\infty) \cap Y \in (b,\infty)\right)$, is is an intersection, but when one takes a complement it is a union. Is that correct?

Yeah, it comes from DeMorgan's law from set theory: $(A\cap B)^c = A^c\cup B^c$.
In your case, we have that
$$((X>a)\cap(Y>b))^c = (X>a)^c\cup(Y>b)^c.$$