Faithful to biblical teaching, the sages gave numerous expressions to the principle that G-d is accessible to all mankind, and that religious experience and merit is not confined to the children of Israel:
The Holy One declares no creature unfit, but receives all. The gates of mercy are open at all times, and he who wishes to enter may enter. [16] 24
R. Meir said: What is the proof that even a gentile who occupies himself with Torah is like a high priest? Scripture says, "With which if a man occupy himself, he shall live by them" (Lev. 18:5). It does not say, "A priest, a Levite, an Israelite," but, "A man."
Hence you may infer that even a non-Jew who occupies himself with Torah is like a high priest. [17] 25
R. Jeremiah used to say: What is the proof that even a gentile who keeps the Torah is like a high priest? The verse "Which if a man do, he shall live by them." . . . Thus even a gentile who keeps the Torah is like a high priest. [18] 26
[The prophet] Elijah said: I call heaven and earth to witness that whether it be Jew or gentile, man or woman, manservant or maidservant, the holy spirit will rest on each in proportion to the deeds he or she performs. [19] 27
"The Lord loves the righteous." Says the Holy One, blessed be He, "They love Me and I love them also." And why does the Holy One, blessed be He, love the righteous? Because their righteousness is not a matter of heritage or family. You will find that priests form a father's house . . . Therefore a man may wish to become a priest and yet he cannot; he may wish to become a Levite and yet he cannot. Why? Because his father was not a priest or a Levite. But if a man, even a gentile, wishes to be righteous, he can do so, because the righteous do not form a house. Therefore it is said, "Ye that fear the Lord bless ye the Lord." It is not said, "the house of those that fear the Lord" but "ye that fear the Lord", for they form no father's house. Of their own free will, they have come forward and loved the Holy One, blessed be He, and that is why He loves them. This is what is meant by the words, "The Lord loves the righteous." [20] 28
"Your priests are clothed with righteousness" (Ps. 132:9). These are the righteous of the nations of the world, such as Antoninus and his companions, who in this world are as priests for the Holy One. [21] 29
Similar sentiments are to be found in the writings of Maimonides and Rav Kook:
Not only the tribe of Levi but every single individual from among the world's inhabitants whose spirit moved him and whose intelligence gave him the understanding to withdraw from the world in order to stand before G-d to serve and minister to Him, to know G-d, and he walked upright in the manner in which G-d made him, shaking off from his neck the yoke of the manifold contrivances which men seek - behold, this person has been totally consecrated and G-d will be his portion and inheritance for ever and ever. [22] 30
As to your question about the nations, know that the Lord desires the heart, and that the intention of the heart is the measure of all things. That is why our sages say, "The pious among the nations have a share in the world to come", namely, if they have acquired what can be acquired of the knowledge of G-d, and if they ennoble their souls with worthy qualities. There is no doubt that every man who ennobles his soul with excellent morals and wisdom based on the faith in G-d, certainly belongs to those destined for the world to come. That is why our sages said, "Even a non-Jew who studies the Torah of our teacher Moses is like a high priest." [23] 31
I have already written in my letters that from the perspective of select individuals, we know no distinction between peoples and languages and "a non-Jew who studies Torah is like a high priest." [24] 32
Thus, when the sages came to give conceptual expression to the relationship between G-d and "the nations" they summarised them in the form of two principles (albeit not without internal argument). The first was that righteous gentiles have a share in the world to come:
Rabbi Eliezer said that none of the gentiles has a portion in the world to come, as it says, "The wicked will return to Sheol, all the nations who have forgotten G-d" (Psalms 9:18). Rabbi Joshua said that if Scripture had stated, "The wicked will return to Sheol [namely]: all the gentiles," and was thereafter silent, it would agree with your interpretation. However, since Scripture states, "who have forgotten G-d," it teaches that there are righteous among the nations, and they do have a portion in the world to come." [25] 33
The law follows R. Joshua 34. The second - established in the context of a closely related concept, that of the ger toshav, the "resident alien" or non-Jew who has citizenship rights in a Jewish state - was that the precondition of being among "the righteous of the nations" was fulfilment of the seven Noahide laws:
Who is a resident alien? Whoever, in the presence of three rabbis, obligates himself not to worship idols. This is the opinion of Rabbi Meir. But the sages say, whoever obligates himself to keep the seven commandments binding on the descendants of Noah. Others say . . . who is a resident alien? Whoever eats non-kosher meat but who obligates himself to uphold all the commandments in the Torah except the prohibition of eating non-kosher meat. [26] 35
The law follows the sages. The seven commandments laws are: the establishment of a system of adjudication, and prohibitions against idolatry, blasphemy, murder, sexual immorality, robbery and eating a limb torn from a living animal.