Capital Gains on Home Sale- Marriage Requirements

If I am married after I sale my house, but both events occur in the same tax year, do we still get the $500k exclusion?  It appears we do (just confirming).
Additionally, we will meet all of the rules for the tax year of the home sale and marriage: 

I owned the home for over 2 years.

We will be Married Filing Jointly (MFJ).

Both of us have resided in the home for at least two years prior to the sale.

Neither of us previously claimed a home sale exclusion within the last two years.