You need to be out of the UK for a minimum of 183 days. You need to be in Dubai for at least 1 day in every 180 days to maintain residency.
To obtain tax residency in Dubai you need to be there for 183 days with your centre of life. Pay bills, receive a salary and have a property or a tenancy...