Solve a probability problem

A and B flip coins. A starts and continues flipping until a tail occurs, at which point B starts flipping and continues until there is a tail. Then A takes over, and so on. Let P1 be the probability of the coin landing on heads when A flips and P2 when B flips. The winner of the game is the first one to get:

(1) a total of 2 Heads

(2) a total of 3 Heads.

Plz dont just copy the explanation online which I have seen but could not understand.