Business & farm

From Publication 925:

 

Any passive activity losses (but not credits) that haven’t been allowed (including current year losses) are generally allowed in full in the tax year you dispose of your entire interest in the passive (or former passive) activity. However, for the losses to be allowed, you must dispose of your entire interest in the activity in a transaction in which all realized gain or loss is recognized. Also, the person acquiring the interest from you must not be related to you.

 

See https://www.irs.gov/publications/p925#en_US_2019_publink1000104609