I'm assuming this experiment plays out by first rolling the die, and whatever face value occurs determines the number of coin tosses. Let [tex]X[/tex] denote the random variable for the face value of the die. Then the PMF for [tex]X[/tex] is
[tex]\mathbb P(X=x)=\begin{cases}\dfrac16&\text{for }x=1\\\\\dfrac13&\text{for }x=2\\\\\dfrac12&\text{for }x=3\\\\0&\text{otherwise}\end{cases}[/tex]
If [tex]X=1[/tex], then only one coin is flipped, so [tex]\mathbb P(H=2|X=1)=0[/tex] because getting two of any side of the coin is impossible.
If [tex]X=2[/tex], then the probability of getting two heads is [tex]\mathbb P(H=2|X=2)=\dbinom22\left(\dfrac12\right)^2\left(\dfrac12\right)^0=\dfrac14[/tex].
If [tex]X=3[/tex], then the probability of getting two heads is [tex]\mathbb P(H=2|X=3)=\dbinom32\left(\dfrac12\right)^2\left(\dfrac12\right)^1=\dfrac38[/tex].
By the law of total probability,
[tex]\mathbb P(H=2)=\displaystyle\sum_{x=1}^3\mathbb P(H=2|X=x)\mathbb P(X=x)[/tex]
[tex]\mathbb P(H=2)=0\times\dfrac16+\dfrac14\times\dfrac13+\dfrac38\times\dfrac12[/tex]
[tex]\mathbb P(H=2)=\dfrac1{12}+\dfrac3{16}=\dfrac{13}{48}[/tex]