A building is an enclosed structure, particularly one constructed of solid materials, with some kind of roof and walls. Types include:
Residential buildings are constructed as dwellings. These are where people primarily sleep and do other domestic activities. Examples include apartment blocks and houses.
Commercial buildings are for operating businesses in. Examples include restaurants, stores and office buildings.
Hotels and motels are in a category of building that is both residential (in that people sleep there), and commercial as they are businesses.