You have to be out of the UK for a full tax year (Apr to Apr) to qualify for not paying tax.

If you return to UK without completing the qualifying period you will be required to declare all earnings which will then be laible for tax.

You also have to pay NI contributions for the first 52 weeks after that you have various options.