No, using the proceeds to pay down the mortgage on your main residence will not offset the Capital Gain tax.
The rate on Capital Gains is based on your total income for that year (including the profit from the house)
HERE is a link to the 2024 rates.
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"