You can sell it free of any liability to Capital Gains Tax (tax on difference in cost to bulid and salse price) IF you were to re-invest an amout of money-equal to, or greater than your gain in another house that would then be your principle residence.
In your case you have not said if you are buying again or moving in to another house already owned by your husband. If its the latter you may be able to 'buy' a share in the house from your husband, to offset your liability to CGT on the gain. Your husband could then use this money to reduce the mortgage outstanding.
You need to get advice on thjis from an accountant