The principal residence exemption is designed around continuous personal use, so a basement suite you lived in yourself is treated differently than one you rented to a tenant for several years while living elsewhere.
Filing the correct principal residence designation with your tax return in the year you sell is what actually claims the exemption, and getting it wrong on a long-held home with any rental history can be an expensive mistake to fix later.
An accountant handles the designation itself, but a documented, hand-reviewed valuation and legal fees running roughly $800 to $1,500 at closing both feed into the same net number the estate or the seller ends up with. Get your hand-reviewed valuation from Joel Dyck.