"None of you should give the devil any share of his prayer by believing it is required of him to leave only from his right side. I saw the Prophet ﷺ frequently leave from his left side."
أنه قال: لا يجعل أحدكم للشيطان شيئا من صلاته، يرى أن حقا عليه أن لا ينصرف إلا عن يمينه، لقد رأيت النبي ﷺ كثيرا ينصرف عن يساره.
Bukhari narrated it in the Book of Adhan (852), and Muslim in the Book of the Prayer of Travelers (707), both through the route of Amash, from Umara bin Umayr, from Aswad, from Abdullah bin Masud, who related it as mentioned.There is no contradiction between the hadith of Anas bin Malik, in which he said, "Most of what I saw of the Messenger of Allah ﷺ was that he would leave by his right," and the statement of Ibn Masud, "I often saw the Prophet ﷺ leave by his left." Anas bin Malik is giving a general report, while Ibn Masud is giving a specific report, that the Prophet ﷺ would leave by his left because his chamber was on his left side. This is confirmed by what Abdul-Rahman bin Aswad bin Yazid Nakhai narrated from his father, who said, "I heard a man ask Abdullah bin Masud whether the Messenger of Allah ﷺ, upon finishing his prayer, would leave by his right or by his left." He said, "Abdullah bin Masud replied, 'The Messenger of Allah ﷺ would leave in whichever direction he wished, though most often, when finishing his prayer, he would turn to his left side toward his chamber.'"Imam Ahmad narrated it (4383) from Yaqub (that is, Ibn Ibrahim bin Saad bin Ibrahim bin Abdul-Rahman bin Awf), who said, our father narrated to us, from Ibn Ishaq, who said, Abdul-Rahman bin Aswad bin Yazid Nakhai narrated to me concerning the manner in which the Messenger of Allah ﷺ would leave his prayer, and he related the hadith as mentioned. Its isnad is hasan. Muhammad bin Ishaq, although he practiced tadlis, explicitly stated that he heard it directly.Thus Ibn Masud's objection was directed against those who held that leaving by the right was obligatory, just as he did not hold that leaving by the left was obligatory either. Rather, he attributed his own practice to a specific reason, namely the location of the Prophet's chambers to his left. So the matter is open, and there is nothing objectionable in either practice.Ibn Umar said, "Leave in whichever direction you prefer, on your right if you wish, or on your left if you wish." See Muwatta (1/169).It is also related that Ali bin Abu Talib said, "If he had a need on his right, he would go to his right, and if he had a need on his left, he would go to his left." Tirmidhi mentioned this (2/100).If the two sides are equal, then he may leave in whichever direction he wishes, though the right is preferable, since the Prophet ﷺ loved to favor the right side.It may be that what Anas bin Malik meant was that when the Prophet ﷺ prayed and had no particular need, and did not intend to leave the masjid, or when he prayed in a masjid other than his own, he would often leave by his right. At other times, he would leave straight ahead, as indicated by the hadith of Samura bin Jundab and the hadith of Bara bin Azib.