1. eligible for capital gain exemption: 2 years of primary residence in the past 5 years of ownership.
Example A: owned 2006-2015 (10), primary residence (2006-2007) (2); rented or second home 2008-2013 (6), primary residence (2014-2015) (2), you are eligible for capital gain exemption
But you might not be eligible for all of the gains, because:
2. How much capital gains are exempted:
gains x (prmary residence) / ownership = exempted gains.
same example:
Your exepmted gains= 4/10 of the total gains
You need to pay CGT on 6/10 of the gains.