Anti-competition clauses are legal under UAE law, see here and here. Article 127 of UAE Labour Law specifically allows non-compete clauses related to access to clients of business secrets, provided that
the agreement must be confined, in terms of time, place and the
nature of the business, to the extent necessary to safeguard the
employer's legitimate interests.
which means there is no fixed upper duration of the restriction. This article analyzes some of the nuances of UAE law on this point, and they observe
Concerning the timely limitation, a reasonable duration for a
non-competition clause normally ranges between 3 months to 2 years
from the date of termination of the employment contract. In the past,
it was often held that the (previous) automatic employment ban of 6
months after termination have a similar effect as a non-competition
clause i.e. preventing the employee to enter the country during this
time; hence, it was concluded that a specific non-competition clauses
included in the employment agreement should only be limited to 6
months as well.
Under a ruling by the Dubai Court of Cassation, Petition NO. 58/2008 (as summarized in the preceding analysis), violating a non-compete clause with a duration of 2 years can be enforced, but the onus is on the employer (plaintiff) to prove that they have suffered the alleged damage.