Since you'll be selling your main home (rather than a second home), there's no Capital Gains Tax to pay.
You can give as much money as you like to whomever you like without paying any tax. (There's no such thing as 'gift tax').
With regard to Inheritance Tax, if the gift to your son (to help him buy the house) is only given on the grounds that you'll be allowed to live there as well then it's a 'gift with reservation' and therefore exempted from the rules which would otherwise mean that the money wouldn't count towards the estates of you and your partner when you die after 7 years has passed. So your son wouldn't be any better off with regard to Inheritance Tax than if you'd not made the gift but he'd not be any worse off either. (If, when both you are you partner are longer with us, the value of your combined estates - including any gift with reservation to your son - doesn't exceed £650,000 there's no Inheritance Tax to pay anyway).
So I can't see any potential pitfalls in what you're proposing.