ONE WHO WENT TO ANOTHER CITY ON SHABBOS [Eruvei Chatzeros]
(Mishnah - R. Meir): If one left his house and went to another city, he forbids, whether he is a Yisrael or Nochri.
R. Yehudah says, he does not forbid;
R. Yosi says, a Nochri forbids, but a Yisrael does not, for he is unlikely to return on Shabbos.
R. Shimon says, even if he left his house to spend Shabbos with his daughter in the same city, he does not forbid, for he does not plan to return.
(Rav): The Halachah follows R. Shimon.
This is only if he went to spend Shabbos with his daughter, but not if he went to his son [lest he quarrel with his daughter-in-law, and return].
This is like people say, 'if a male dog barks, enter. If a female barks, leave.'
Rambam (Hilchos Eruvin 4:13): If one left his house and went to another Chatzer, even if it is near his Chatzer, if he has no intent to return on Shabbos, he does not forbid. This refers to a Yisrael. If a Nochri went even to another city, he forbids, unless they rent his Reshus from him, for he might return on Shabbos.
Magid Mishneh: Regarding a Nochri, the Rambam rules like R. Yosi. R. Yochanan (46b) said that we follow R. Yosi against R. Yehudah, even for Eruvin. Especially here we follow R. Yosi, for R. Meir agrees, and they are two against R. Yehudah. Some rule like R. Yehudah. The Rambam's opinion is primary.
Rosh (8:6): The Halachah follows R. Shimon. This is only if he went to his daughter, but not if he went to his son. Regarding a Nochri, the Halachah follows R. Yehudah, who permits. Shmuel rules like R. Yehudah in all of Eruvin. R. Yehoshua ben Levi says that the Halachah follows the lenient opinion in Eruvin. Even though the Halachah follows R. Yosi against R. Yehudah, this is a Klal (general rule). When an Amora explicitly rules like R. Yehudah, we [follow him, and] apply the Klal to other arguments.
Rashba (Teshuvah 3:270): Nochrim own some of the houses in a Mavoy and rented them to Yisre'elim for the year. A Yisrael moved to another Mavoy. The Nochri's house was left empty, just he puts wood in it. It does not forbid. Even if a Yisrael owned it and slept there, as long as his food is not there, he does not forbid, for it depends on where his food is. Even if he lived there and his food was there, if he went for Shabbos to his daughter, or even another place from which he cannot return on Shabbos, he does not forbid, like it says in Eruvin. However, if a Nochri's food was in the Mavoy, even if he is not there, he forbids, for he could come on Shabbos. If a Nochri or Yisrael does not live there, just he uses it for a storehouse, he does not forbid.
Shulchan Aruch (OC 371:1): If a member of the Chatzer left his house and went to another Chatzer, even if it is near his Chatzer, if he has no intent to return on Shabbos, he does not forbid.
Beis Yosef (DH Dirah): Rashi says that R. Meir forbids because he holds that Dirah (a residence) without an owner [there] is called Dirah. R. Yehudah disagrees. The Halachah follows R. Shimon, but not if he went to spend Shabbos with his son. He did not divert his mind from his house, lest he quarrel with his daughter-in-law, and leave. The Tur says so. The Rambam did not distinguish between a son and daughter. The Magid Mishneh says that he holds that the Gemara merely discussed the more a typical case, i.e. spending Shabbos with a daughter. In any case, if he diverted his mind [from his house for Shabbos], even if he went to his son, he does not forbid. If he did not divert his mind, even if he went to his daughter, he forbids.
Magen Avraham (1): The Shulchan Aruch discussed leaving before Shabbos to teach that even if he returns, it is permitted. Alternatively, it says so due to the case of a Nochri. See 383:1. (If a Nochri died on Shabbos, he does not forbid.) Really, even if he was here and did not make an Eruv and left during Shabbos, it is permitted, like one who did not make an Eruv and died on Shabbos.
Gra (DH Im): The Rambam holds that the Gemara merely discusses a typical case. The law is uniform: whenever he diverted his mind [he does not forbid].
Mishnah Berurah (2): The Nochri and his entire family went before Shabbos to another city. Some are lenient even if he left on Shabbos, if he will not return the same day.
Bi'ur Halachah (DH she'Heni'ach): The Magen Avraham said that the same applies if he left during the day. He learns from one who was not Me'arev and died on Shabbos. If the heir does not come, he does not forbid. Even according to the Tur and Shulchan Aruch who are lenient, there is no proof from there. Beis Meir said that here, since he is alive, he could come at any time. R. Yosi's reason (he diverted his mind) applies only to one who went before Shabbos to spend Shabbos elsewhere. Rashi (47a DH Nochri, DH Lishbos) explicitly says so. Gaon Yakov says that the Tur permits only if he left before Shabbos. This is unlike one who died on Shabbos. Here he acquired Shevisah when Shabbos came, so leaving on Shabbos does not uproot his Dirah from here. The Rashba and Ritva explicitly say that he left before Shabbos. Indeed, they forbid even one who died on Shabbos. However, three Rishonim explicitly say that he left before Shabbos, so one should not be lenient if he left on Shabbos. Eliyahu Rabah says that the Tur discusses Stam, but if he explicitly diverted his mind from returning on Shabbos, he does not forbid even if he left on Shabbos. I say that this is like Stam going to a daughter, and even so, the Tur said that he left during the day. Therefore, one may not be lenient. In pressed circumstances, perhaps one may rely on the Magen Avraham if he explicitly diverted his mind.
Bi'ur Halachah (DH Im): The Rashba says that going to a son is like going to a stranger. The Rambam must agree that Stam going to a daughter is Hesech ha'Da'as. If not, how is she unlike a son? Tosefes Shabbos says that the Rambam and Shulchan Aruch equate sons and daughters. This is wrong. All the Rishonim distinguish. Presumably, the Rambam agrees.
Note: Perush ha'Mishnayos says "he must go to a house in which he can dwell, therefore it says his daughter." If the Mishneh Torah and Shulchan Aruch distinguish, why didn't they say so? However, it is also difficult to say that the Shulchan Aruch does not distinguish, and did not even mention the opinion of the Rishonim who distinguish!
Kaf ha'Chayim (4): The Magid Mishneh says that the Rambam equates sons and daughters. The Shulchan Aruch rules like this. The Poskim agree.
Shulchan Aruch (ibid.): This refers to a Yisrael. If a Nochri went even to another city, he forbids, unless they rent his place from him if he is within one day's journey, for perhaps he will return on Shabbos.
Beis Yosef (DH uv'Plugta): Regarding the argument of R. Yehudah and R. Yosi [about a Nochri], the Rosh says that the Halachah follows the lenient opinion in Eruvin. Mordechai, Semag, Ramban and Rashba agree. Even if the Nochri could return the same day, as long as he does not return, he does not forbid. However, the Rambam rules like R. Yosi. Surely, he is stringent only if the Nochri is within one day, and could come on Shabbos. On 62b we say that R. Meir forbids only in this case. We learn from him to R. Yosi. If R. Yosi argued with R. Meir about a Nochri, he would have explicitly said so.
Magen Avraham (2): Even though even someone far away could have started returning before Shabbos until close to here, we are not concerned for this.
Mishnah Berurah (3): In 371:1, some permit only if he went more than one day's journey away, and some permit even if he was closer than this.
Shulchan Aruch (ibid.): If he is more than one day's journey away, he does not forbid. Some say that also if a Nochri went for Shabbos to another Chatzer, he does not forbid.
Taz (1): The Shulchan Aruch connotes that it does not matter that he could come on Shabbos. In 365:7, we (the Rema) rule(s) that if a Lechi or Korah is destined to be destroyed on Shabbos, it is Pasul [after it is destroyed]! I answer that there, it is prone to be ruined, e.g. through Nochrim, who often do so. Here is different. Indeed, if the Nochri often returns home the same day, he forbids! Here we discuss when he left to spend the entire day elsewhere.
Mishnah Berurah (7): This is like a Yisrael who went to spend Shabbos elsewhere and diverted his mind from his house. It is considered as if he does not live there that Shabbos.
Bi'ur Halachah (DH b'Chatzer): The Bach brings that Tosfos and the Rosh permit only if he went to another city. The Rashba agrees. Korban Nesan'el was astounded at the Shulchan Aruch. It suffices to be lenient like R. Yehudah, who discusses another city! However, Ri'az (in Shiltei ha'Giborim 28a:2) permits even if he went to another Chatzer. We are lenient like R. Yehudah, who equates Nochrim to Yisre'elim, and that another Chatzer is like another city. In any case, this is a lone opinion. Also, the first opinion forbids every case of a Nochri.
Kaf ha'Chayim (12): The Mechaber favors the first opinion. One may rely on the latter opinion only in pressed circumstances.
Rema: This seems primary.