Thanks, guya.
Now what happens if you leave the UK (let's say for 2-3 years) and then return to the UK as a resident. Does your clock re-set?
As Guya said, the rule is 7 of the last 9 years so you'd have to be out of UK for 3 years for clock to restart.
Here's an example where you would have made 7/9 test in 2011 as you were gone for only 2 tax years (08 & 09):
2002 2003 2004 2005 2006 2007 2008 2009 2010 2011
- UK UK UK UK UK - - UK UK
Here's an example where you would have made 7/9 test in 2016 as you were gone for 3 tax years (07-09):
2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
- UK UK UK UK - - - UK UK UK UK UK UK UK
I assume you have to be gone for the ENTIRE tax year so you could be gone for nearly 4 years but still not reset the clock. For example, if you moved to the US in May 2008 and returned in March 2012 you would still have taxes in 2008-09 year and 2011-12 year. This means you were gone for only 2 tax years even though you were gone for 3 years 10 months.
Guya, can you confirm you must miss entire tax year?