We calculate probability according to first person's throws

1st throw: probability of getting H and win is

1/2
2nd throw: probability of A getting T, B getting T and A getting H is

(1/2)^3
3rd throw: probability of A getting T, B getting T, A getting T again, B getting T again, then A finally getting H on third throw is:

(1/2)^5
4th throw: same process and you get

(1/2)^7
5th throw: same process and you get

(1/2)^9
Probability of first thrower winning is just sum of individual probabilities.

_________________

Best Regards,

Paul