Primary home: Partial Exclusion of Gain

Hi everyone, 

We're selling our home which we own for less than 2 years & we claim it as 'primary home' during pandemic:

- I work from this home for the past 1.5 years, and my spouse stays here on and off

- We're now selling this home, and buying another one in different location

 

Based on the IRS publication, page 6 https://www.irs.gov/pub/irs-pdf/p523.pdf, I should meet the requirement under Partial Exclusion of Gain, by claiming the following:

- My spouse buys the new place as 'primary home'

- And i sell this house with the reason of my job requires me to return to the office (my office is not in the same location of new primary home)

Am I right in my understanding?

 

Thank you in advance,