I bought house A 28 years ago and lived there until I bought house B in Dec 2009. My son went to live in house A in June 2011. If I was now to sell him house A I would be liable to pay CGT on the purchase BUT if I moved them to house B and went to live in house A myself would I then have to pay CGT and if not how long would I have to move back to house A for it to become my primary residence?
I assume house A was your primary residence up to Dec. 2009. If so, if you now sell house A you will not pay any CGT on the gain because the last 3 years of ownership will be exempt. See here:
If you move back to house A it will become your primary residence again immediately you move there. If you then sell house B you will not have any CGT liability on it if it has been your primary residence throughout your ownership.