I didn't understand the part where the solution represented in the image attached. I know that the E(H) should be 0, but what I don't understand is how they get to this equation.
Could you please help me to understand the equation?
This is an application of the law of total expectation.
Let $A$ be the event that tails landed on the first throw and $A^c$ is the event that heads lands on the first throw. Then, by the law of total expectation we have:
$$E(T)=E(T\mid A)P(A)+E(T\mid A^c)P(A^c)=\frac12E(T\mid A) +\frac12E(T\mid A^c)$$
Here $E(T\mid A)$ denotes the conditional expectation given $A$, i.e. the expectation of $T$ if you know $A$ happened.
If tails lands on the first throw, we have $1$ 'tails' result for sure so the expected number of tails on the whole is $1$ + the expected number of tails from the second throw forward.
Furthermore, starting from the second throw we basically have the same experiment of throwing coins until heads lands. We reset the experiment in a way, thus the expected number of tails from the second throw onward is also $E(T)$.
That's how we get $E(T\mid A)=1+E(T)$.
For $E(T\mid A^c)$ we can easily see that if heads lands on the first throw, the experiment is finished, and no tails were seen, so the number of tails is $0$.
Combining all that was said, we get $E(T)=\frac12(1+E(T)) +\frac120=\frac12(1+E(T))$.
From that we easily reorder the equation and get $E(T)=1$.