"Definition:
sojourner
a temporary inhabitant, a newcomer lacking inherited rights
of foreigners in Israel, though conceded rights"
That would be in contemporary terms a legal immigrant, either in the first case, on a visa, or in the second, a first-generation American. NOT an illegal.
Did Jesus make a distinction in offering eternal salvation between illegals or not? I seem to recall the woman brought to him to stone was caught red-handed in an illegal act worthy of the death penalty (He did tell her "Go and sin no more" I will grant you).