The 330 rule usually gets most people and so it is better to opt for the bonafide resident rule if applicable and then you don't have to spend 330 days out of the U.S. You do however, have to be a bonafide resident for a period encompassing an entire tax year. If your host country pays your local taxes (no tax in Dubai I assume) the you can claim that and your tax burden is minimized. In the UAE you would be issued a resident permit which would then begin the period of bobafide residence.