Heat energy is lost from buildings through their roofs, windows, walls, floors and through gaps around windows and doors. However, there are ways that these losses can be reduced.
Take a look at this thermogram of a house. It shows that the roof is cold, which suggests it's well insulated. The windows are red and orange which show that the most heat is lost through them.
Heat energy is transferred from homes by conduction through the walls, floor, roof and windows. It is also transferred from homes by convection. For example, cold air can enter the house through gaps in doors and windows, and convection currents can transfer heat energy in the loft to the roof tiles. Heat energy also leaves the house by radiation through the walls, roof and windows.