[quote user=flyingsquirrel]If I rent out a property, can it still be my principal residence and exempt from capital gain tax?
No. You only get tax free capital gains on one principal residence at a time, and you have to be living in it. That being said, if you bought a property 2 years ago and lived in it until now, and gain from the then until now is tax free, and any gain going forward would be taxable.
The CRA has a process to follow when converting a property from a principle residence to a rental property, I think you may need to get an appraisal or market valuation done.
It sounds to me (and I'm not an accountant) that you can change your personal residence to a rental property and not pay capital gains later if you make the correct election. There are numerous conditions: only for 4 years, must pay tax on rental income and can't use CCA, and the reason you're moving is that you or your spouse are moving more than 40km for work. You also have to move back into the property after.
If this very specific situation does not apply to you, then a brief description of the rules can be found here.
I think you may be misinterpretting the "4 years" thing. It's an exemption for people who have to move for work for a short time. If that isn't your situation, then the exemption has nothing to do with you.
IE. I live in Calgary, and own a house. If my work transferred me to Dallas for a year, I could rent my house out for that year, and then move back into it when I came back to Calgary, and maintain my personal residence status.
I really don't think this is a loophole you'll be able to exploit for tax free capital gains treatment on your investment portfolio, and it's probably important that you don't try to do so.
If you're just talking about paying tax on your actual personal residence, you can stay as long as you want and not pay tax. It's just a straight exemption.