The Shulchan Aruch · Orach Chayim
אורח חיים שפ״גOrach Chayim 383
Siman 383 of 697 in Orach Chayim — 1 se'if
הלכות ערוביןLaws of Eruvin· siman 383
Se’if 1א׳
עַכּוּ"ם הַדָּר עִם שְׁנֵי יִשְׂרָאֵלִים וְאֵין הָעַכּוּ"ם בְּבֵיתוֹ, אֵינוֹ אוֹסֵר עַיֵּן לְעֵיל סִימָן שע"א וִיעָרְבוּ וְיִהְיוּ מֻתָּרִים. בָּא עַכּוּ"ם בְּשַׁבָּת, אוֹסֵר וְהָעֵרוּב בָּטֵל. וּמִיהוּ יְכוֹלִים לִשְׂכֹּר מִמֶּנּוּ בְּשַׁבָּת, וְאַחַר כָּךְ יְבַטֵּל הָאֶחָד לַחֲבֵרוֹ וְיִהְיֶה הַיָּחִיד מֻתָּר; וְכָל שֶׁכֵּן אִם מֵת הָעַכּוּ"ם בְּשַׁבָּת, שֶׁיְּבַטֵּל אֶחָד לַחֲבֵרוֹ וְיִהְיֶה הַיָּחִיד מֻתָּר.
When the non-Jew is not in the house, he does not prevent [the eruv]. And it contains one paragraph. A non-Jew who lives with two Jews, when the non-Jew is not in his home, does not prohibit (see above, siman 371), and they may make an eruv and be permitted. If the non-Jew comes on Shabbat, he prohibits and the eruv is nullified. However, they can rent from him on Shabbat, and afterwards one can nullify his domain to the other, and the individual will be permitted. And all the more so, if the non-Jew died on Shabbat, one can nullify his domain to the other and the individual will be permitted.
Shulchan Aruch, Orach Chayim — Torat Emet 363 edition, via Sefaria — public domain
English: Sefaria Community Translation — CC0