عَنْ زَيْدِ بْنِ ثَابِتٍ رَضِيَ اللَّهُ عَنْهُ أَنَّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ اتَّخَذَ حُجْرَةً فِي الْمَسْجِدِ مِنْ حَصِيرٍ فَصَلَّى فِيهَا رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَآلِهِ وَسَلَّمَ لَيَالِيَ حَتَّى اجْتَمَعَ إِلَيْهِ نَاسٌ ثُمَّ فَقَدُوا صَوْتَهُ فَظَنُّوا أَنَّهُ قَدْ نَامَ فَجَعَلَ بَعْضُهُمْ يَتَنَحْنَحُ لِيَخْرُجَ إِلَيْهِمْ، فَقَالَ: ((مَا زَالَ بِكُمُ الَّذِي رَأَيْتُ مِنْ صَنِيعِكُمْ حَتَّى خَشِيتُ أَنْ يُكْتَبَ عَلَيْكُمْ، وَلَوْ كُتِبَ عَلَيْكُمْ مَا قُمْتُمْ بِهِ، فَصَلُّوا أَيُّهَا النَّاسُ فِي بُيُوتِكُمْ، فَإِنَّ أَفْضَلَ صَلَاةِ الْمَرْئِ فِي بَيْتِهِ إِلَّا الْمَكْتُوبَةَ))
It is narrated from Sayyiduna Zaid bin Thabit (may Allah be pleased with him) that the Noble Prophet (peace and blessings be upon him) made a small room with a mat in the mosque and prayed in it at night. When people found out, they also gathered, but then they could not hear the voice of the Noble Prophet (peace and blessings be upon him). They thought that he (peace and blessings be upon him) had fallen asleep, so some people started coughing so that he (peace and blessings be upon him) would come out to them. Then he (peace and blessings be upon him) said: I am aware of what you have been doing. The real matter is that I fear this standing (in prayer) may be made obligatory upon you, and if it is made obligatory, you will not be able to maintain it. Therefore (I say that) O people! Pray in your homes. A man's prayer in his house is the best deed, except for the obligatory prayer.