The primary residence exclusion on capital gain tax is 250K per person, 500K per couple.
The taxable gain is calcuated by deducting sales price minus (the purchase price, the cost of purchase and the cost of sales (agent commission etc) and all cost invovled in improve the home (new roof, new kitchen etc)).
You can rent out the home for 3 years after you moved out, if you sold the home before your move out date + 3 years, you can claim the whole amount of the exclusion. However, if you sold your house after you moveout date + 3 years, you lose the exclusion completely. But renting out 3 years won't save you any taxes. You'll have the hassle of reporting 3 years of rental income and depreciation it just make things for complicated if you are not a landlord.
1031 exchange won't work right now, because 1031 exchange is only for investment property, not primary residence.
Your best course of action is sell the house now. When you can't sell house for a good price, consider rent out for 1-2 years tops. Again, renting won't save you any taxes.