How does IRS calculate 2 years as primary residence for tax exemption

I want to sell my primary residence next year and want to see if I qualify for the $500,000 tax exemption when I file my 2022 year's taxes. I filed my 2020's taxes at this address and will file 2021 at this address as well. If I sell the property in 2022, would I qualify for the tax exemption?