So when and how did Obama become a lawful permanent resident?
Barry Soetoro returned to Hawaii as an unaccompanied minor in 1971. He was taken into Federal Protective Custody. Eventually, he became a Permanent Resident Alien of the U.S. shortly after that.
When he was 15,16, his legal custodian (located in Connecticut) filed for a SSN for him. Permanent Resident Aliens are allowed to apply for and receive an SSN.
http://www.cppp.org/repatriation/Backgrounder2.pdf