Here is the advice from Tax Aid:
'You can be away from your principal private residence for work (4 years in UK; without restriction if abroad) or any other reason (up to 3 years) and still qualify for these periods so long as you re-occupy the property as your principal private residence after the absence. This requirement to re-occupy the property is relaxed in respect of absences resulting from work where the terms of employment prevent re-occupation of the property.'
The legislation specifically states 'sole or main domestic residence.' Note the word 'or' not 'and.' HMRC like to interpret the legislation as 'and' and this is incorrect. The Inland Revenue tried the same trick in the mid 70s and retired with a considerable amount of egg on their faces. As you are selling your sole of main domestic residence PRR is given automatically. If challenged merely advise the the absence was due to working overseas.
Please be so kind as to rate me before you leave the Just Answer site.