Mosques are revered places for Muslims, so you must follow a conservative dress style if you visit any mosque, especially the Grand Mosque. Both men and women must cover their arms and legs and avoid wearing skirts or shorts shorter than their ankles. Tight-fitting and transparent clothes are a big no-no when visiting the Grand Mosque. A headscarf will be given while entering, for females to cover their hair within the premises. You will have to take off your shoes before entering the building.
Attire that covers your body completely until your wrists and ankles are encouraged. Loose-fitting long pants or a maxi dress in a breathable fabric like cotton will do. These are some of the etiquettes that you need to keep in mind:
Men should also cover up and avoid wearing shorts! Choose full-length pants and thin shirts whenever possible. Plain clothing is preferred over t-shirts with designs and slogans. Although it's not usually required, you can be asked to take off your shoes before entering the mosque. But it's wise to be prepared in case you do!
image Source : https://www.szgmc.gov.ae/en/mosque-manner