Covering the head
In The Name of Allah, The Most Merciful, The Bestower of Mercy.
Allah, The Exalted, said:
قُلْ أَمَرَ رَبِّي بِالْقِسْطِ ۖ وَأَقِيمُوا وُجُوهَكُمْ عِندَ كُلِّ مَسْجِدٍ وَادْعُوهُ مُخْلِصِينَ لَهُ الدِّينَ ۚ كَمَا بَدَأَكُمْ تَعُودُونَ
Say (O Muhammad): My Lord has commanded justice and (said) that you should face Him only in every place of worship, and invoke Him only making your religion sincere to Him. As He brought you (into being) in the beginning, so shall you be brought into being (on the Day of Resurrection). [Al-A’raf 29]
[قُلْ أَمَرَ رَبِّي بِالْقِسْطِ – Say (O Muhammad): My Lord has commanded justice]– Meaning, uprightness in worship and justice in dealings, neither oppression nor tyranny.
[وَأَقِيمُوا وُجُوهَكُمْ عِندَ كُلِّ مَسْجِدٍ – And you should face Him only in every place of worship]- Meaning, you should face Allah only (i.e. worship none but Allah), strive to accomplish the acts of worship, especially the Salah, and perform it outwardly (i.e. performed properly with its pillars, conditions, and obligation) and inwardly (i.e. with sincerity, complete submission, etc) and purify it from every deficiency and corruption. [وَادْعُوهُ مُخْلِصِينَ لَهُ الدِّينَ – And invoke Him only making your religion sincere to Him]- Meaning, intend only Allah through it (i.e. your worship) without associating any partner to Him. (4)
Allah, The Mighty and Majestic, says:
يَٰبَنِىٓ ءَادَمَ خُذُوا۟ زِينَتَكُمْ عِندَ كُلِّ مَسْجِدٍ وَكُلُوا۟ وَٱشْرَبُوا۟ وَلَا تُسْرِفُوٓا۟ إِنَّهُۥ لَا يُحِبُّ ٱلْمُسْرِفِينَ
O Children of Adam! Take your adornment (by wearing your clean clothes), while praying and going round (the Tawaf of) the Ka’bah, and eat and drink but waste not by extravagance, certainly, He (Allah) likes not Al-Musrifun (those who waste by extravagance). [Al-A’raf 31]
Meaning: Cover your Awraat (i.e. those body parts that must be covered during the prayer) during the prayer, whether it is a mandatory or voluntary prayer. Covering them is an adornment for the body, just as exposing them makes the body unsightly and unpleasant. It is possible that what is meant by adornment here is clean and nice clothing. In this command to cover the Awrah during prayer, making oneself look nice, cleanliness, and avoidance of impurities and filth are all included. (1)
Covering The Head
Imam Abdul Azeez Bin Baz, may Allah have mercy upon him, was asked:
س: إمام يصلي بالناس وليس على رأسه غطاء فما الحكم في هذا؟
What is the ruling on an imam leading the prayer without a head covering?
: لا حرج في ذلك؛ لأن الرأس ليس من العورة، وإنما الواجب أن يصلي بالإزار والرداء؛ لقول النبي ﷺ: لا يصلي أحدكم في الثوب الواحد ليس على عاتقه منه شيء لكن إذا أخذ زينته واستكمل لباسه كان ذلك أفضل؛ لقول الله جل وعلا: يَا بَنِي آدَمَ خُذُوا زِينَتَكُمْ عِنْدَ كُلِّ مَسْجِدٍ [الأعراف: 31] أما إن كان في بلاد ليس من عادتهم تغطية الرأس فلا بأس عليه في كشفه
There is no harm in that because the head is not considered part of the Awrah, but it is obligatory to pray with an Izar and a Rida as the Prophet, peace and blessings of Allah be upon him, said: “None of you should pray in a single garment with nothing on his shoulders”. However, when he adorns himself with clothing and completes his clothing that would be better. This is because Allah, The Most High, says: “O children of Adam, take your adornment at every masjid” [Al-A’raf: 31]. However, if it is in a country where it is not their custom to cover the head, then there is no harm in uncovering it. (2)
السائل : ما حكم الصلاة والرجل حاسر رأسه ؟
الشيخ : صلاة الرجل وهو حاسر رأسه أي كاشف رأسه لا بأس بها لأن ستر الرأس ليس بواجب ، لكن إذا كان الإنسان في بلد من عادتهم أن يستروا رؤسهم ، وهم يرون أن ذلك من كمال الزينة ، فإن الأفضل للإنسان أن يستر رأسه باللباس الذي يعتاده الناس لعموم قوله تعالى : (( يا بني آدم خذوا زينتكم عند كل مسجد )) .
فنحن هنا في بلادنا في المملكة العربية السعودية نعتاد ستر الرأس بالطاقية والغترة وعليه فيكون ستر رؤوسنا بذلك أفضل من كشفها لأن هذا من تمام الزينة التي أمر الله تعالى بأخذها في قوله : (( يا بني آدم خذوا زينتكم عند كل مسجد )).
The questioner: What is the ruling on the prayer while a man is covering his head?
Imam Muhammad Ibn Salih Al-Uthaymeen, may Allah have mercy upon him, responds: A man’s prayer while his head is uncovered is permissible, as covering the head is not obligatory. However, if a person resides in a country where it is customary to cover the head and this is considered part of proper adornment, then it is better that he wears a head covering in accordance with the general guidance of the Quranic verse: “O Children of Adam, take your adornment at every place of worship.” In our country, the Kingdom of Saudi Arabia, it is customary to cover the head with a Taaqiyah or a Ghutrah (a), and thus, covering the head is deemed better than leaving it uncovered, as this aligns with the complete adornment that Allah has commanded in the aforementioned Ayah. (3)
Also read: What kind of clothing is appropriate for those with Shariah knowledge in a specific country? https://salafidawahmanchester.com/2024/07/22/what-kind-of-clothing-is-appropriate-for-those-with-shariah-knowledge-in-a-specific-country/
[a] Taaqiyah and Ghutrah
Taaqiyah

Ghutrah

[1] Tafsir as-Sadi
[2] Majoo Fatawaa 10/405
[3] https://alathar.net/home/esound/index.php?op=codevi&coid=56219