It is stated in the Gemara (64a) that Rava asked Rav Yosef: If there were five hired workers and five Israelite gleaners with a Kuti, what is the law? And he answered him: If they said "his hired worker and his gleaner" to be lenient, would they say "his hired worker and his gleaner" to be stringent? And Rashi explained that the question was since his hired worker and his gleaner can rent out and are like owners, and if so, when each one dwells in a room alone—if it were their domain, they would all need to give a share in the eruv—and now that it is the domain of the Kuti, do they need an eruv? And likewise, when there are residents in the courtyard, if they need to give a share in the eruv. And he answered him, that we do not say "his hired worker and his gleaner" to be stringent, and they are as if they are not there, and are nullified relative to the Kuti who is the master of the house. And based on this, the Tur and the Shulchan Aruch wrote in section 16: "If a Kuti has five hired workers or five Israelite gleaners dwelling in his house—their dwelling is not considered a significant dwelling such that they would prohibit one another." Thus far his words. And our teacher, the Rema, concludes with this wording: "For the hired worker (so it should be said) of a Kuti—does not prohibit, if he rented from the master of the house." Thus far his words. That is to say, when there are residents in the courtyard, and they rented the domain from the Kuti or from one of the hired workers and gleaners—they then do not prohibit, even though each one dwells in a room by himself. And in truth, the Ritva wrote there that it deals with a case where they do not eat there and do not sleep there, but otherwise—they are obligated in an eruv. But such is not the opinion of the Tosafot (72b), who brought proof from this law for what was explained in siman 370, section 15, regarding one who keeps a teacher or a scribe in his house and uses all the vessels of the master of the house—that he does not prohibit, see there, and so too regarding a hired worker and a gleaner. And our teacher, the Beit Yosef, in his great book added another reason for this, and this is his wording: "For since it is possible that tomorrow it will occur to the master of the house to switch their rooms... it is not called a designated place." Thus far his words. And also there regarding a teacher or a scribe this was said, and there another reason was explained—that he did not lend them his domain to prohibit him, see there. And it seems to me that this reason does not apply here, for there the master of the house does so entirely for free. But regarding a hired worker and a gleaner—he is doing his work. However, the primary reason for this law is as we said, that this is not called a designation and permanence of place. But when a Kuti or an Israelite rented a room to an Israelite, this is not in the category of a hired worker and a gleaner—and he prohibits, and must give a share in the eruv of the courtyard.
איתא בגמרא (ס"ד.) דאביי שאל לרב יוסף - היו אצל הכותי חמשה שכירים וחמשה לקיטים ישראלים מהו. והשיב לו - אם אמרו שכירו ולקיטו להקל, יאמרו שכירו ולקיטו להחמיר. ופירש רש"י שהשאלה היתה כיון דשכירו ולקיטו יכול להשכיר והוי כבעלים, ואם כן כשכל אחד דר בחדר לבדו, (שאילו) [שאלו] היתה רשות שלהן היו כולן צריכין לתת חלק בעירוב, והשתא דרשותא דכותי הוא - האם צריכים עירוב. וכן כשיש דיורין בחצר, אם צריכים ליתן חלק בעירוב. והשיב לו, דאין אומרים שכירו ולקיטו להחמיר, והרי הן כאינן, ובטילין לגבי הכותי שהוא הבעל הבית. ועל פי זה כתבו הטור והש"ע סעיף ט"ז: "אם יש לכותי חמשה שכירים או חמשה לקיטים ישראלים דרים בביתו - אין דירתם חשובה דירה שיאסרו זה על זה" עכ"ל. ומסיים רבינו הרמ"א בזה הלשון: "דשכירו (כן צריך לומר) של כותי - אינו אוסר, אם שכרו מבעל הבית" עכ"ל. כלומר דכשיש דיורין בחצר, ושכרו הרשות מהכותי או מאחד מהשכירים והלקיטים - שוב הם אינם אוסרים, ואף על פי שכל אחד דר בחדר בפני עצמו. ובאמת הריטב"א כתב שם דמיירי שאין אוכלין שם ואין לנין שם, אבל בלאו הכי - חייבים בעירוב. אבל לא כן דעת התוספות, (ע"ב.) שהביאו ראיה מדין זה למה שנתבאר בסימן ש"ע סעיף ט"ו, במי שמשהה מלמד או סופר בביתו משתמש בכל כלי בעל הבית - שאינו אוסר ע"ש, והכי נמי בשכירו ולקיטו. ורבינו הב"י בספרו הגדול הוסיף עוד טעם בזה, וזה לשונו: "דכיון שאפשר שלמחר יעלה על דעת בעל הבית להחליף חדריהם… - לא מקרי יחוד מקום" עכ"ל. וגם שם במלמד או סופר נאמר כן, ובשם נתבאר עוד טעם - שלא השאיל להם רשותו לאסור עליו ע"ש. ונראה לי דטעם זה לא שייך בכאן, דשם עושה הבעל הבית בחנם לגמרי. אבל בשכירו ולקיטו - הא עושה עבודתו. מיהו עיקר טעם דין זה הוא כדאמרן, דזה לא מקרי יחוד וקביעות מקום. אבל כשכותי או ישראל השכיר חדר לישראל, אין זה בגדר שכירו ולקיטו - ואוסר, וצריך ליתן חלק בעירוב של החצר.