Hi Adamczyk40, thank you for joining the "Ask the Experts: Moving" special forum today.
I believe you question refers to the home sale gain exclusion: Taxpayers can exclude up to $250,000 ($500,000 if married filing a joint return) gain on the sale of a principal residence if the following eligibility tests are satisfied - Ownership test and Use test.
You lived in the "2nd home turned primary home" for 6 months. The Use test rule - The taxpayer must have used the home as his or her principal residence for at least two years out of the last five years ending on the date of sale. Therefore, you will need to pay capital gain to the state where the home is located.
There is also a "Look-Back" rule that you cannot claim the home sale gain exclusion during the 2-year period before the date of sale.
Furthermore, there is no deferral of capital gain when you used the 2nd main home sale proceeds to purchase the 3rd main home because this is personal in nature.
IRS Pub 523 Selling Your Home has great information.
https://www.irs.gov/pub/irs-pdf/p523.pdf
Hope this helps.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"