...
One who rents a house/room outside the Land, or one who lodges at an inn in Eretz Yisrael/ the Land of Yisrael, is exempt from Mezuza for thirty days. But one who rents a house/room in Eretz Yisrael requires Mezuza immediately, due to [the mitzwah of] yeshuv (dwelling in) Eretz Yisrael. (And this is the law for someone who borrows a house; the law is like the renter.) (BY in the name of R' Manoah [Manoah B. Jacob?] and so it seems in Shas)
The Gemara notes: That distinction is also taught in a baraita: In the case of one who resides in a guesthouse [pundaki] in Eretz Yisrael, or one who rents a house outside of Eretz Yisrael, for the first thirty days he is exempt from the mitzva of mezuza; from then on he is obligated. But one who rents a house in Eretz Yisrael must affix a mezuza immediately, due to the settlement of Eretz Yisrael.
...
M627
§ The mishna teaches: And how long must one live in the city to be considered like one of the people of the city? Twelve months. And we raise a contradiction from what is taught in a baraita: In the case of a donkey caravan or a camel caravan that was journeying from place to place, and it lodged inside an idolatrous city, and its members were led astray along with the other residents of the city, and they too engaged in idol worship, they, the members of the caravan, are liable to death by stoning like ordinary individual idolaters, and their property escapes destruction, i.e., they are not treated like the residents of an idolatrous city, who are liable to death by the sword and whose property is destroyed.