Assuming you are a UK national, you will be entitled to the personal allowance whether you are UK resident or not. If you become UK resident, you will be taxable on your worldwide income, not just UK income. That's the difference between being UK tax resident and non- UK tax resident.
I hope this helps but let me know if you have any further questions.
Take a look at the flowchart here. You cannot work more than 30 days in the UK in a tax year or your non-UK tax residency may be jeopardised which might bring non-UK income into the UK tax net.
You might also refer to RDR3 for detailed information on the Statutory Residence Test.
I have to go out for a while but will be back to answer any further questions you may have a bit later today.
You should be non-resident. Paragraph 3.15 in RDR3 as it applies to you says that the 18 days you will have worked for 2 hours a day won't count as part of the 40 days. I'm assuming you have been non-UK resident for the three previous tax years but have spent 90 days .
Ignore the "but have spend 90 days" part of my previous post.