In Dubai, expatriates are permitted to stay in the country as long as they own a property. If you own a property, you can stay in Dubai for an unlimited period of time. You will also be able to renew your visa when it expires without leaving the country.
In order to obtain a residence visa, you will need to have a passport with at least six months of validity and an original copy of an Emirates ID or residence visa. You will also need your current work permit and a letter from your employer stating that they intend to sponsor you for residency. These documents must be submitted within 14 days from the date on which you have entered the country as a visit visa holder.
Once you have been granted citizenship, you will have to move out of the country for at least 24 hours after six months before you can apply for permanent residence status.
Once you have been granted residency status, your spouse and children under 18 years old can be included on your UAE visa if they are in possession of their passport and national ID card copies.
Provided that you do not violate any rules and regulations during your stay in UAE, then you should be able to legally stay in the country permanently once you have obtained residency status.