Home Sale Capital Gain

I sold my primary residence home 8/12/19. I had owned the home for over 4 years and qualified for capital gains exclusion. We then bought a new home. We sold the new home on 4/2/21 die to taking a new job and relocating out of state (over 50 miles away). I have read that you can only use the home sale capital gains exclusion once every two years. My realtor said we should quality for an exemption to the exclusion because we sold the home in less than two years due to a job relocation. Is this accurate? I wanted to verify before doing this years taxes.