Get your taxes done using TurboTax

The general rule of living in the house for 2 of the past 5 years does not fully apply if the house has been rented out. Any depreciation recapture is not allowed to be excluded. Also you will have to apportion the gain between qualified use and non-qualified use. So if you have lived in the house 7 years but rented it out 3 years you can only exclude 70% of the capital gain. The only way to defer the taxes on the house is to either not sell the property or do a 1031 like kind exchange. 1031 exchanges only apply to business property, so you would need to rent out the property after the exchange.

Since this is a large dollar value and complicated issue I would recommend speaking to a professional tax preparer.