I'm trying to build a world that has the setting of medieval or middle-ages fantasy. Stuff like adventurer guild and so on is also implemented alongside the usual mercenary and freelance knight. One of the problems I'm facing is their lodging. I know that there were inns in the medieval era. But I am aiming at maybe a dorm-like type of lodging that the adventurer/mercenary can rent for a few months or so. Is there a type of lodging like that that actually existed in the past? Maybe like a boarding house? But from what I know, the concept of boarding house appeared around the 19th century. Any input, information, or reading material will be greatly appreciated.
Usual caveats: I assume you mean Western and Central European Middle Ages. I assume that you know the difference between the Middle Ages and the Renaissance. Hint: if your world has courtly love, it's the Middle Ages. If it has middle class or noble women flirting with adventurers, it's the Renaissance.
The Middle Ages were not spectacularly different from the Ultra Modern age in what concerns accomodations. Essentially, from the cheapest to the most expensive, during the High and Late Middle Ages you could rent:
A place on the floor in the common room strewn with fresh straw (or not). This was usually rented by the night; it was the basic accomodation available at inns for the vast majority of travelers (such as pilgrims, couriers or servants of richer travelers).
A place in a bed in the common room or in a private room. This was rented by the night; it was the typical accomodation for middle-class travelers, such as not very rich merchants. It was very common. Sexes were separated, of course; but since public baths were unisex, this did not matter much.
A room. This could be rented by the night at an inn (by very rich travelers, or by a group of travelers), or by the month or year in a town or a city (for use by middle-class people, such as merchants, lawyers, clerks, students etc. who had to spend some time away from home).
A room and board. Rented by the month or year in towns or cities by middle-class eople, such as merchants, lawyers, clerks, students etc. who had to spend some time away from home. Has the advantage of providing basic service and food at a competitive price. Has the disadvantage that the basic service and food were usually nothing to write home about.
A suite of rooms. This was rented by the month or year by rich people, such as successful merchants, professors, medical doctors, and of course noblemen who had to spend some time away from home. Usually included accomodation for the suitable number of servants (typically, places in beds in common rooms).
A wing of a palace. Rented by the year by very rich noblemen or noblewomen (say, from duke or duchess onwards) who had to spend considerable time away from home, either in a diplomatic or military mission for their lord (emperor or king or prince...), or in exile. More commonly it was provided free of charge by the local ruler.
In the Early Middle Ages the post-classical population crash was so severe that inns were a rarity, and so was money. No way to rent something, except in exceptionally civilized cities, such as Rome or Paris or London.
Almost nobody traveled for fun. Travel had almost always a practical or spiritual purpose. It was both expensive and dangerous.
Such things were quite different in the Eastern Roman Empire, and later in the Arab world and the Ottoman Empire. They had much better travel infrastructure and services were more readily available.
Upper middle class men (and their betters) always traveled with servants. Middle class women (and better) always traveled with servants. Honorable lower class women never traveled without their husbands. Men seldom traveled with their wives.
Houses were very rarely available for rent, if at all. A room, a suite of rooms, or a wing in a palace. Not a house.
Hospitality was thing. In peaceful ares/regions/countries well-off people who stayed some time away from home tended to arrange accomodation through family or professional relationships. In remote places even poor peasants offered overnight hospitality to weary travelers.
From Canterbury Tales
Befell that in that season on a day
In Southwark at The Tabard as I lay
Ready to wenden on my pilgrimage
To Canterbury with full devout couráge,
At night was come into that hostelry
Well nine and twenty in a company
Of sundry folk by áventure y-fall
In fellowship, and pilgrims were they all
That toward Canterbury woulden ride.
The chambers and the stables weren wide
And well we weren easėd at the best.
In the prologue above the narrator describes a tavern named the Tabard where he and fellow travelers are stopping on their pilgrimage. Chambers were wide and food was good as can be seen in the picture. This is was about 1300. I am not sure how long a person could stay - probably until his money ran out.
May I encourage your writings to take inspiration from the Millers Tale.
The next I can think of is from the early 1600s. From The Three Musketeers
Thus d'Artagnan entered Paris on foot, carrying his little packet under his arm, and walked about till he found an apartment to be let on terms suited to the scantiness of his means. This chamber was a sort of garret, situated in the Rue des Fossoyeurs, near the Luxembourg.
My first thought was "tavern", but that idea has been extensively explored already. Most people didn't travel from their home in Medieval Europe, but an exception were the "Journeymen".
A skilled young person, having completed their apprenticeship, could travel from town to town. Having presented themselves at the town office, or aldermen (to have their identity checked), they would be introduced to the local guild, where they would offer their skills, in exchange for bed and board. If your adventurer were to disguise himself as a "journeyman", he could get free lodging, without raising too many eyebrows. However, the guilds tried to stop this. Journeymen had to wear distinctive clothing, kept passbooks, and used secret handshakes to make it hard for adventurers or others to disguise themselves as workers.
This tradition still exists in parts of Europe, notably in Germany, where there are about 800 people on the "walz" at any time.
In France, buildings used for housing journeymen exist and are known as a cayenne. Large ones may house 100 "Compagnons" at a time.
Further ideas from https://en.wikipedia.org/wiki/Journeyman_years, https://en.wikipedia.org/wiki/Compagnons_du_Tour_de_France and links therein.