Once a home is rented, the years it is rented generally no longer qualify for the principal residence exemption when you eventually do sell, so you can end up owing tax on the gain for that rental period even if the home was your principal residence for decades before and after.
There is a Canada Revenue Agency election that can defer the deemed disposition in some circumstances, but it comes with conditions and a filing deadline, so this is not something to decide without professional tax advice before you sign a lease, and it is worth weighing against legal fees of $800 to $1,500 you would pay to sell instead.
Getting tax advice before renting, not after, is the only way to know the real cost of that decision. Get your hand-reviewed valuation from Joel Dyck.