Was this your primary home? Sorry it doesn't matter what you do with the proceeds. The old rule about rolling it over went out back in 1997.
Starting in May 1997…..For a primary home, if you owned and lived in your house for 2 out of the last 5 years on the date of sale when you sell you can exclude the gain up to $250,000 for single or 500,000 for married from tax. You can not take a loss on your tax return. The rule about rolling over the gain to the next house went out in May 1997.
To exclude gain under the rules in this publication, you in most cases must have owned and lived in the property as your main home for at least 2 years during the 5-year period ending on the date of sale.
If you made more than a 250,000 (500,000 for joint) gain then the amount over it is taxed. Doesn't matter what you did with the proceeds like buy another house or pay off the mortgage.