It depends on the definition of “resident” under the law. The courts have used having a permanent address as the usual definition but resident gets defined on a case by case basis. it is usually contrasted with “tourist.”
Barack Obama had a permanent address in Honolulu, Hawaii and then in Cambridge, Massachusetts.
Since there was never any legal action taken concerning his associations or marital status, those points are moot. He was never deported, eventually Harvard recommended his visa extension not be renewed and tbe INS agreed. He returned to Kenya.
I think you are just dancing around the point. I don't think the Wong Kim Ark court would have regarded him as a resident. Certainly Chief Justice John Marshall wouldn't have agreed that he was a resident.