Generalization of words flats, commercial spaces, garages
Solution 1:
The term property is used to denote one, or a set of buildings.
The Cambridge Dictionary has
a building or area of land, or both together:
He owns a number of properties on the south coast.
The notice said "Private property - keep off!"
Yes, I've bought my own house - I'm now a man/woman of property!
The Oxford Dictionaries has
1.1 A building or buildings and the land belonging to it or them.
he's expanding now, buying property
Solution 2:
I would say that "building" is maybe a better term for what you're describing (rather than "house"). A house implies that it is a living space, so your "commercial space" example wouldn't fit with the term "house."
However, an apartment building could have rooms (studios), flats (individual apartments), or other spaces for rent. Or, an office building would have office spaces for rent, though likely not individual rooms.