Between the dates of December 23, 1952 and November 13, 1986, when one parent was a US citizen and the other a foreign national, the US citizen parent must have resided in the US for a total of 10 years prior to the birth of the child, with five of the years after the age of 14. An exception for people serving in the military was created by considering time spent outside the US on military duty as time spent in the US.
Obama's mother had him when she was 18 and therefore did not meet that criteria if he was born outside the US.