It is narrated from Sayyiduna Abu Rafi' (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) forbade a man from praying while his hair is tied up (in a knot).
Hadith Referenceالمعجم الكبير للطبراني / باب الألف / 986
Sayyiduna Abu Rafi' (may Allah be pleased with him) said: "The Messenger of Allah (peace and blessings be upon him) passed by me while I was in prostration and had tied up my hair, so he (peace and blessings be upon him) undid it and forbade me from that."
Hadith Referenceالمعجم الكبير للطبراني / باب الألف / 987
Sayyiduna Abu Rafi' (may Allah be pleased with him) saw Sayyiduna al-Husayn bin Ali (may Allah be pleased with them both) in prostration with his hair tied up, so Abu Rafi' (may Allah be pleased with him) said: I heard the Prophet (peace and blessings be upon him) saying: "None of you should pray while his hair is tied up."
Hadith Referenceالمعجم الكبير للطبراني / باب الألف / 988
Sa'id bin Abi Sa'id (may Allah have mercy on him) narrates from his father that he saw Sayyiduna Abu Rafi' (may Allah be pleased with him), the freed slave of the Messenger of Allah (peace and blessings be upon him), pass by Sayyiduna Husayn bin Ali (may Allah be pleased with them both) while Husayn was praying standing, and he had tucked his braid into the nape of his neck. Abu Rafi' (may Allah be pleased with him) undid it, and Husayn (may Allah be pleased with him) turned around angrily. Abu Rafi' (may Allah be pleased with him) said: Attend to your prayer and do not be angry, for I heard the Messenger of Allah (peace and blessings be upon him) saying: "That is the seat of Satan." That is, the place where Satan sits, meaning the place where the braid is tucked.
Hadith Referenceالمعجم الكبير للطبراني / باب الألف / 989