The rule allowing you to defer the tax on the sale of a home by applying it to another home was eliminated from the tax law in 1997, 25 years ago. Under the current tax law it makes no difference what you do with the money from selling your home.
The old law was replaced by an exclusion of gain from the sale of your main home. If you owned and lived in the home for 2 out of the last 5 years prior to the sale, you will probably be eligible to exclude from your taxable income up to $250,000 of the profit on the sale (up to $500,000 if you are married filing jointly). Any gain above the excluded amount will be taxable income. For more details on qualifying for the exclusion, see Topic No. 701 Sale of Your Home on the IRS web site, and IRS Publication 523, Selling Your Home.