If he was a foreign student he would have needed an F-1 foreign student visa. No one can study in the U.S. as a foreigner without being allowed into the country on a visa.
Obama’s father’s passport and student visa records were released by a Freedom of Information Act application.
But, he wasn’t living in Indonesia at the time .. he was living in America. Therefore, all he had to do was say he was born in a foreign country - even if he didn’t live there anymore.
Remember, the left loves to bestow it’s perks on foreigners .. it’s just Americans they don’t like.