Deductions & credits

I don’t think I can address every possible scenario you suggest. Let me give you a couple of clarifying remarks that I notice from your question, and then you can ask any follow ups.

At the present time, you can claim an exclusion on home 1 as long as you sell before January 2024.  Even though you are married, your spouse cannot claim an exclusion on home 1 because she has not lived there for 731 days.  

At the present time, you both qualify to use the exclusion on home 2 if you sell it.  Because you have both lived there since the marriage, and ownership is imparted to both of you by marriage even if both of you were not on the deed, I don’t believe you can split the exclusion. In other words, I don’t think your spouse can claim the $250,000 exclusion when you sell home 2 while you keep your hands clean.

 

If you sell home 2 and claim the exclusion, then you would not qualify to use any exclusion on home 1 unless you wait at least two years from the date of the previous sale where you used the exclusion.  You could claim a partial exclusion on the sale of home 1 if you sell in less than two years, but only if you sell because of a change in job location, unemployment, or other unforeseeable  financial circumstances that make it impossible for you to keep the home.  In that case, the partial exclusion would be calculated based on how long it had been since you last used the exclusion. For example, if you sell home 2 in January 2024, and then you sell home 1 in July 2024 due to a hardship, you would qualify for an exclusion equal to 25% of the usual limit (6months/24 months); in other words $62,500. Any gain over that would be taxable. 

In addition, renting home 1 out and then moving back into the home creates an unfavorable tax situation called “non-qualified use“. The period of time when you rented the home is not qualified for any exclusion if you move back. The point of the exclusion is to encourage residential home ownership, not reward landlords.  Giving a thorough explanation of non-qualified use would take a long time, but the practical upshot in your case is that if you lived in home 1 for three years, then rented it for three years, then moved back for one year, 3/7 of your gain is non-qualified. You will pay capital gains tax on 3/7 of the gain, and then the remaining 4/7 of the gain is eligible to be covered by your personal $250,000 exclusion. Your spouse would still not qualify to use any part of her exclusion (because she won't have lived there 2 years) unless the reason that you sold the home was due to an unforeseeable financial emergency, which allows a shorter residence time.

 

You want to start by thinking about where you want to live, why you might want to move, and which home has the larger capital gain.  Deciding where to live based only on the tax position may be unsatisfying for other reasons.  

 

Your lowest tax situation would be to sell home 1 before January 2024, and then remain in home 2 for at least two more years.  If you sell home 2 and use the full $500,000 exclusion, and move back into home 1, you create an unfavorable situation with home 1 due to the non-qualified use rule, no matter how long you remain living at home 1.