Get your taxes done using TurboTax

For a primary home, if you owned and lived in your house for 2 out of the last 5 years when you sell you can exclude the gain up to $250,000 for single or  500,000 for married from tax.  You can not take a loss on your tax return.

 

But you will also have to recapture the depreciation you took or could have taken while you were renting it.  The depreciation will be taxable.