Here is more info for you and others who may have a similar question.
The federal capital gains tax exemption allows for an exemption of $250,000 for a single person and $500,000 for a couple. The rules are as follows:
You must live in the home as your primary residence for 2 out of the last 5 years.
The purchase price of your home, including some transaction costs, is deducted from your sale price less some transaction costs. You then deduct capital improvements from this amount. If it is less than the exemption amount that applies, then you have no capital gains tax to pay. If it is greater, then you have to pay capital gains tax on the amount above the exemption amount.
Buy a property in 2005 for $300,000 including transaction costs
Sell the property for $700,000 in 2008, including transaction costs
While you owed it, you replaced the roof for $30,000
Less Purchase $300,000
Less Capital imp. $30,000
Capital gain of $370,000
Exemption of $250,000 (assuming it was your home that you lived in and that you are single)
Taxable capital gain $120,000
I hope this helps you and other with similar questions. Contact me if you need a referral for an accountant.