We will figure out the general question first: if we have n consecutive events with two possible outcomes which we will tell "successes" and "failures" with probabilities p and 1-p, respectively, we call they have a binomial distribution. Then, the chance to obtain exactly k successes out of the n trials is: (n chooses k)(p^k)(p-1)^(n-k). ( where (n chooses k) is the binomial coefficient ).
Applying this formula to our problem we have: success if we obtain heads with probability p=0.5 and a failure if we obtain tails with probability 1-p=0.5, and we have n=3 trials at total and we ask the probability to obtain 2 heads = 2 successes. ( the successes and failures depends on how we choose what we will call success and what failure. We have to give them the right corresponding probabilities and trial )
Then we obtain the following expression: (3 chooses 2)(0.5^2)(0.5^1)=3*0.125=0.375