Capital Gains on home sale due to job loss?

If I sold my home in 2021 and I had it less than 2 years but lost my job, do I have to report capital gains on the sale? I was told no but am looking to verify.