If you had the house for 10 years and you rented out 2/3 for 5 years and you lived their by yourself for another 5 years
When you living there as your principle residence you get cap gain exception.
for the other 5 years
Tax to Pay = (Gross Profit over 10 years) x ( 0.5 x 0.66 ) x...