The 51st prohibition is that we are forbidden from allowing idol worshippers to reside in our land, to prevent us from being influenced by their heresy.

The source of this commandment is G‑d's statement (exalted be He),1 "Do not allow them to reside in your land, since they may then make you sin against Me."

Even if he just wants to pass through2 our land, we are not allowed to do so unless he accepts upon himself not to worship idols. Once he does so, he is allowed to reside [in eretz Yisrael], and is called a ger toshav,3 meaning that he is considered a convert only to the extent that he is allowed to reside in our land. Our Sages said,4 "Who is a ger toshav? One who accepts upon himself not to worship idols. This is the opinion of Rabbi Yehuda."5

An idol worshipper, however, is not allowed to reside [in our land], and we do not sell him land nor rent to him. The [Oral] Tradition states clearly,6 "You may not allow him any residence in the land."

The details of this mitzvah have been explained in Sanhedrin and in Avodah Zarah.