$A$ wins on the first toss if $T$, probability $(1-p)$
$B$ wins on the second toss if $HH$, with probability $p^2$
If neither wins in two tosses, we are back to the start.
Thus for both to have equal chances, $(1-p) = p^2$
Proceed....
> $0.5(\sqrt5 - 1)$