Investors & landlords

If I understand correctly, we would take the "basis" of the portion of the home we depreciated, (say it was $200,000 for the apts.) and deduct the total amount depreciated over the 20+ years (say $50,000) and anything over $500,000 would be considered capital gains?  So in this scenario, we wouldn't have any capital gains specifically....?

 

Thank you very much for responding.