Praise be to Allah.
Allaah says (interpretation of the meaning):
“O Children of Adam! Take your adornment (by wearing your clean clothes) while praying…” [al-A’raaf 7:31]
Adorning oneself for prayer is something that is additional to covering the ‘awrah. Hence, for men, head not being part of awrah is not compulsory for covering. Whereas, for women, head being part of awrah, women are commanded to cover their heads when praying, although they are allowed to uncover their heads in front of their mahrams.
Furtherermore, for men, if covering the head is customarily regarded as a part of adornment in a particular country, then the head should be covered, otherwise it does not have to be covered.
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said: It was narrated that Ibn ‘Umar said to his freed slave Naafi’: “Do you go and meet people bareheaded?” He said: “No.” He said: “Allaah has more right that you should be modest before Him.”
This indicates that it is better to cover the head, but if we apply the words of Allaah - (interpretation of the meaning): “O Children of Adam! Take your adornment (by wearing your clean clothes) while praying” [al-A’raaf 7:31] – to this issue, we will see that covering the head is better among people who regard covering the head as a kind of adornment. But if we are among people who do not regard that as a kind of adornment, we do not say that covering it is better or that leaving it bare is better.
It is proven that the Prophet (peace and blessings of Allaah be upon him) used to pray in a turban, and the turban is a head covering. End quote. Al-Sharh al-Mumti’, 2/166
And Allah knows the best