The rules come from Law No. 26 of 2007 Regulating the Relationship between Landlords and Tenants in the Emirate of Dubai, as amended by Law No. 33 of 2008. Article 7 is the starting point: a valid lease cannot be ended unilaterally by either party during its term, and it can only be terminated by mutual consent or in the cases the law provides. That single sentence explains why a tenant with a job offer in another country cannot simply hand back the keys, and why a landlord cannot cut a lease short to sell the property mid-term.
Article 21 then governs the condition of the property at the end: the tenant returns it in the condition in which it was received, except ordinary wear and tear and damage due to reasons beyond the tenant's control. Article 20 allows the landlord to hold a security deposit and requires its refund, or of the remainder, when the lease ends. Article 22 puts government fees for the use of the property on the tenant unless the contract says otherwise, and Article 23 stops a tenant from removing leasehold improvements on leaving unless the parties agree otherwise.
Registration matters too. Article 4 requires leases and their amendments to be registered, which means Ejari, and the Dubai Land Department explains in its tenancy guide on Ejari registration and the final water and electricity bill that a new contract is not registered for the property before the former contract ends, the settlement with the former tenant is presented and the final DEWA invoice is produced. No Dubai text sets a compensation rate for leaving early: one or two months' rent is common, but it is a figure the parties choose.