See there are 6 boxes to fill.
For such probs. always imagine things..try to visualize
If you fill first three by H (which stands for Head), only the possibility of 2 Hs exist that too after a gap of 1 box: HHHTHH== Max. 5 Hs expected
Now, similarly second way in which 3 Hs can come in a row: THHHTH==Thus only 4 Hs expected at max
similarly Third way: HTHHHT=4 Hs again at max
now Fourth way: HHTHHH= 5 Hs at max.
So do sum of individual possibilities of H in all 4 instances:
1: (1/2)^3 * (1/2)^2
2: (1/2)^3 * (1/2)
3: (1/2)^3 * (1/2)
4: (1/2)^3*(1/2)^2
Calculating===> (1/2)^4 {1/2+1+1+1/2}
===> 1/16*6/2===>3/16
Hope that Helps.
PS in probablities, there r no shortcuts please dont go by formulas rather try visualize imho