So, you should do a rough estimate or have a tax professional do one for you, on how much of the proceeds should be set aside to cover the capital gains tax. You will not want to invest in anything with low liquidity like another investment property, and then get hit with a tax bill you can't pay.
The result of a divorce is the sale of a former residence that was rented for a number of years. The property was in my husband's name and when the property was sold the proceeds were split between the two of us. If I want to use part of the gains to pay off debts and part to put into investment property, am I responsible for the capital gains tax only on the part of the gains that I used to pay off debts or on all of the gains from the sale?