We sold our rental home in 2020 and did a lot of improvements in the last 4 years. How do we get the full deductible amounts to reduce capital gains?

We replaced a roof, installed a new kitchen, replaced a deck and front porch etc. We logged them as assets to depreciate, but they have not completed their depreciation.