Deductions & credits

Under section 1.121-3 of the regulations, there must be a change of circumstances which is the proximate reason for the sale.  Factors used to determine if the change in circumstances was the proximate reason include,

(1) The sale or exchange and the circumstances giving rise to the sale or exchange are proximate in time;

(2) The suitability of the property as the taxpayer's principal residence materially changes;

(3) The taxpayer's financial ability to maintain the property is materially impaired;

(4) The taxpayer uses the property as the taxpayer's residence during the period of the taxpayer's ownership of the property;

(5) The circumstances giving rise to the sale or exchange are not reasonably foreseeable when the taxpayer begins using the property as the taxpayer's principal residence; and

(6) The circumstances giving rise to the sale or exchange occur during the period of the taxpayer's ownership and use of the property as the taxpayer's principal residence.

 

You can't meet tests 1, 2 or 3, because nothing changed in 2024 that made the home unsuitable, or unaffordable, and it was 5 years after the job change.  There is or was nothing stopping you from selling the home before June 2024, and no recent change of circumstances forcing you to sell the home in July 2024.

 

While it is true that "only the IRS can judge" if you are audited, I don't see a lot of support for a partial exclusion in your scenario.  Can you close the sale in June?