Cap Gains exclsuion on multiple properties

Hi so I read some of the other posts but our situation varies slightly from the others I've read where some form of this is possible when 2 spouses own a house prior to being married.  Want to make sure we are maximizing our usage as it pertains to the tax code.

 

-I purchased home 1 Jan 2018 and lived there until Jan 2021 and rented since. So far I still meet 2 of the last 3 years' requirements, if sold by Jan 2023. Estimated gain if sold: 150k

-Then gf moved in Apr 2020, married Sep 2020 and also lived there until Jan 2021.

-Wife/I purchased home 2 Jan 2021, she is only on the mortgage but we are both on title.  So we will both have to mark it as receiving 50% proceeds?  Estimated gain if sold: 200k

 

If we sold house 2 this year in 2023 and moved back to house 1 before Jan 2024, could I not take my part of the exclusion to allow for an exclusion in 2024 if house 1 was sold sometime next year?

Do we need to sell house 1 first? She does not meet the requirements for taking the exclusion as she lived there less.  If that's the case, can I take that exclusion and when we sell house 2 she can take 50% and I won't be eligible due to once every 2 years?

What happens if they are sold the same calendar year?

 

Much appreciated 🙂