The exemption covers the land and the house together, up to about half a hectare, and applies to one property per family unit for a given year. If you owned a second property, a rental or a cottage at the same time, only one of them can claim the exemption for the overlapping years.
Where it gets more complicated is a home that changed use, such as a house you rented out before moving in, or a basement suite you rented while living upstairs. The Canada Revenue Agency prorates the exemption in those cases, so the safe move is asking an accountant before you list rather than after you close.
Joel Dyck routes every seller to that conversation early, because the tax answer shapes the listing timeline more than the market does. Get your hand-reviewed valuation from Joel Dyck.