Deductions & credits

Per Section 1.121-1(a) it appears to be fairly unambiguous.

 

(3) Special rules for joint returns—(i) In general. A husband and wife who make a joint return for the year of the sale or exchange of a principal residence may exclude up to $500,000 of gain if—

 

(A) Either spouse meets the 2-year ownership requirements of §1.121–1(a) and (c);

 

(B) Both spouses meet the 2-year use requirements of §1.121–1(a) and (c); and

 

(C) Neither spouse excluded gain from a prior sale or exchange of property under section 121 within the last 2 years (as determined under paragraph (b) of this section).

 

 

The deduction here hinges upon the filing status rather than the status of the parties at the time of the sale.