Deductions & credits

You mean renting out the prior house?  That can work.

 

If you sell, it doesn't matter what you do with the proceeds or gain.  You have to report it the year you sell it.

 

The old rule about rolling it over to a new house stopped in 1997.  

 

If you sold your Main Home see,

https://ttlc.intuit.com/community/home-ownership/help/is-the-money-i-made-from-a-home-sale-taxable/0...

 

It's based on the date of sale.

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.