The wait for the first heads is geometric with success probability 1/2. If E is the expected number of flips, then E = 1 + (1/2)E because after a tails the process restarts. Solving gives E/2 = 1, so E = 2.