Switch Primary Residence, Home Sale in Different State, Capital Gain Exclusion

Here is my situation. My wife works in TX and I work in VA. We have filed the tax jointly. We sold our home in TX in 2023 where we stayed there for 11 years and move to another property in the same city. I understand we qualified for the capital gain exclusion of 500k in 2023. We have a condo in VA where I stay most of the time (I work in VA). If I sell this condo in 2024, can we switch the primary residence from TX to this VA condo and claim the tax benefit?