Selling 2nd home

I'm assuming that if I can't use the rental exchange 1031 or main home exclusion, I would have to take long term capital gains tax when I sell it (?).  But does that exclude me from selling my main home the following tax year and use the main home exclusion?

Thanks for any feedback.