You won't have to pay the stamp duty surcharge as you are replacing your main residence with another main residence if you complete on the sale before you complete on the purchase. If you complete on the purchase before the sale, you will have to pay the surcharge. However, so long as you sell the old main residence within three years of buying the new one, you can claim a refund of the surcharge.
For the purpose of the surcharge, a married couple are treated as "one unit". Take a look here for more information.
I hope this helps but let me know if you have any further questions.