Hi
The form P85 is used to notify HMRC that you are leaving the UK.
It allows HMRC update your records and would be completed provided you do not need to submit self assessment tax returns for the tax year in which you leave the UK.
You can get the form here
Get your Income Tax right if you're leaving the UK
The number of days you can spend in the UK and not be considered resident for tax purposes, would need to be worked out, as other factors can reduce the number of days considerably.
You would need to apply the residency tests to determine that maximum number of days you can spend in the UK and not be resideent for tax purposes. You can find details here
RDR3 Statutory Residence Test
Thank you