שֶׁלֹּא לְהוֹשִׁיב עוֹבֵד עֲבוֹדָה זָרָה בְּאַרְצֵנוּ – שֶׁלֹּא לְשַׁכֵּן עוֹבְדֵי עֲבוֹדָה זָרָה בְּאַרְצֵנוּ, שֶׁנֶּאֱמַר לֹא יֵשְׁבוּ בְּאַרְצְךָ פֶּן יַחֲטִיאוּ אֹתְךָ לִי. To not have worshipers of idols dwell in our Land: To not have worshipers of idolatry dwell in our Land, as it is stated (Exodus 23:33), “They shall not dwell in your Land, lest they cause you to sin against Me.”
מִשָּׁרְשֵׁי הַמִּצְוָה, מָה שֶׁנִּגְלֶה בַּכָּתוּב, בִּשְׁבִיל שֶׁלֹּא נִלְמַד מִכְּפִירָתָם. From the roots of the commandment is what is revealed in the verse — so that we not learn from their heresy.
דִּינֵי הַמִּצְוָה. כְּגוֹן מַה שֶׁאָמְרוּ זִכְרוֹנָם לִבְרָכָה (ע"ז סד ב) שֶׁאִלּוּ רָצוּ לְהַנִּיחַ עֲבוֹדָה זָרָה אַף עַל פִּי שֶׁעֲבָדוּהָ מִתְּחִלָּתָן שֶׁמֻּתָּרִים לִשְׁכֹּן בְּאַרְצֵנוּ, וְזֶהוּ הַנִּקְרָא גֵּר תּוֹשָׁב, כְּלוֹמַר שֶׁהוּא גֵּר לְעִנְיַן שֶׁהֻתַּר לֵשֵׁב בְּאַרְצֵנוּ, כְּמוֹ שֶׁאָמְרוּ זִכְרוֹנָם לִבְרָכָה (שם) אֵי זֶהוּ גֵּר תּוֹשָׁב? זֶה שֶׁקִּבֵּל שֶׁלֹּא לַעֲבֹד עֲבוֹדָה זָרָה. וְאִם לֹא הִנִּיחַ עֲבוֹדָה זָרָה אֵין צָרִיךְ לוֹמַר שֶׁאֵין מוֹכְרִין לוֹ קַרְקַע שֶׁיִּשְׁכֹּן בְּאַרְצֵנוּ, אֶלָּא (שם כא א) אֲפִלּוּ לְהַשְׂכִּיר לוֹ בַּיִת, אָסוּר כָּל זְמַן שֶׁיִּשְׂכֹּר לְדִירָה, לְפִי שֶׁמַּכְנִיס שָׁם עֲבוֹדָה זָרָה. אֲבָל לִסְחוֹרָתוֹ מֻתָּר, וּבִלְבַד שֶׁלֹּא יַשְׂכִּיר לִשְׁלֹשָׁה בְּנֵי אָדָם, לְפִי שֶׁשְּׁלֹשָׁה דְּבַר קְבִיעוּת הוּא וְאֵין רָאוּי לְקָבְעָם. וְחִלּוּק הַדִּינִים שֶׁאָמְרוּ רַבּוֹתֵינוּ זִכְרוֹנָם לִבְרָכָה שֶׁיֵּשׁ בְּעִנְיָן זֶה בֵּין בָּתִּים לְשָׂדוֹת וּכְרָמִים, וּבֵין סוּרְיָא לְאֶרֶץ יִשְׂרָאֵל, וְיֶתֶר פְּרָטֶיהָ, מְבֹאָרִים בְּסַנְהֶדְרִין וַעֲבוֹדָה זָרָה [שם]. The laws of the commandment: For example, that which they, may their memory be blessed, said (Avodah Zarah 64b) that if they wanted to leave idolatry, even though they worshiped it at their beginning, they are permitted to live in our Land, and that is what is called a resident stranger (convert) — meaning to say, he is a convert regarding that he is permitted to reside in our Land. [It is] as they, may their memory be blessed, said (Avodah Zarah 64b), “Who is a resident convert? The one who accepted not to worship idolatry.” But, if he did not leave idolatry, it is not necessary to say that we do not sell him land to dwell in our Land; but rather even to rent him a house is forbidden (Avodah Zarah 21a), so long as he rents it as a residence — since he will bring idolatry [into it]. But it is permitted for his business, so long as he not rent it to three people [or more] — since three is a matter of permanence, and it is not fit to make them permanent. And the difference in laws that our Rabbis, may their memory be blessed, said there is between houses, and fields and vineyards, and between Syria and the Land of Israel — and the rest of its details — are elucidated in Sanhedrin and Avodah Zarah. (See Tur, Yoreh Deah 191.)
וְנוֹהֶגֶת בִּזְכָרִים וּנְקֵבוֹת בָּאָרֶץ. וְהָעוֹבֵר עָלֶיהָ וּמָכַר לָהֶם קַרְקַע אוֹ הִשְׂכִּירוֹ לָהֶם בְּמָקוֹם שֶׁאֵינוֹ רַשַּׁאי עָבַר עַל מִצְוַת מֶלֶךְ, וְאֵינוֹ לוֹקֶה, לְפִי שֶׁאֶפְשָׁר לִמְכֹּר לָהֶם קַרְקַע אוֹ לְהַשְׂכִּיר בְּלֹא עֲשִׂיַּת מַעֲשֶׂה. And [it] is practiced by males and females in the Land. And one who transgresses it and sells them land or rents it to them in a place that is not permitted has transgressed the commandment of [the] King. But he is not lashed — as it is possible to sell them land or rent [it] without an act.