This is just a binomial distribution where “success” is getting two heads. Let’s calculate the probability of such an event.
$$P(HH) = P(H)P(H)=0.4624$$
So this is our “p” in the binomial distribution. The other parameter in the binomial distribution is $n$, the number of attempts, which is $100$. Now calculate the probability of getting exactly two “successes”, which is exactly what a binomial tells you.
$$f(x)=\binom{100}{x}
0.4624^x (1-0.4624)^{100-x}$$
The trick to generalizing this is recognizing the “p” parameter in the binomial distribution. It’s always the probability of getting the number of flips.
EDIT
Binomial PMF in general:
$$
f(x\vert n,p)=\binom{n}{x}p^x(1-p)^{n-x}
$$