שולחן ערוך, אורח חיים שפ״ד

Shulchan Arukh, Orach Chayim 384

עכו"ם אכסנאי אם מעכב. ובו ב סעיפים:
עכו"ם הנכנס לשם אכסנאות אם נכנס שלא ברשות אינו אוסר לעולם ואם נכנס ברשות אם הוא רגיל לבא אוסר מיד ואם אינו רגיל אינו אוסר עד לאחר שלשים יום:
A Non-Jewish Guest, Whether He Prevents [Carrying]. Containing 2 paragraphs:
A non-Jew who enters as a guest: if he entered without permission, he never prevents [carrying]. If he entered with permission — if he regularly comes, he prevents [carrying] immediately. If he does not regularly come, he does not prevent [carrying] until after thirty days.
אנשי חיל המלך שנכנסו בבתי היהודים בין בחזקה בין ברצון אם יש לבעלי בתים באותם מקומות שנכנסו העכו"ם כלים שאסור לטלטלם בשבת אינם אוסרים עליהם:
The king's soldiers who entered into the homes of Jews, whether by force or willingly — if the homeowners have in those places where the non-Jews entered utensils that are forbidden to move on Shabbat, [the non-Jews] do not prevent [carrying] upon them.

Maginei Eretz: Shulchan Aruch Orach Chaim, Lemberg, 1893 (Public Domain) · Sefaria Community Translation (CC0) · 2 se'ifim