Capital Gains

I sold my home in California in February 2022. My capital gains were over $250k. I am getting married in 2 weeks. Can we file jointly and be exempt from the 1st $500k capital gains or since I’m marrying after the sale of the house am I only except on the 1st $250K?

 

Thank you.