Investors & landlords

I understand the first part fully.

 

The second part I would like to clarify that it's possible that I can use the losses for the rental to go against the depreciation recapture on the sale? I am aware I have a huge amount of depreciation recapture, the "loss" from is not even remotely close.