Zaid b. Thabit reported: The Messenger of Allah (may peace be upon him) made an apartment with the help of the leaves of date trees or of mats. The Messenger of Allah (may peace be upon him) went out to pray in it. People followed him and came to pray with him. Then they again came one night and waited (for him), but the Messenger of Allah (may peace be upon him) delayed in coming out to them. And when he did not come out, they cried aloud and threw pebbles at the door. The Messenger of Allah (may peace be upon him) came out in anger and said to them: By what you have been constantly doing, I was inclined to think that it (prayer) might not become obligatory for you. So you must observe prayer (optional) in your houses, for the prayer observed by a man in the house is better except an obligatory prayer.
Hadith In Arabic Text :
حدثنا قتيبة بن سعيد، حدثنا يعقوب، – وهو ابن عبد الرحمن القاري – عن سهيل، عن أبيه، عن أبي هريرة، أن رسول الله صلى الله عليه وسلم قال ” لا تجعلوا بيوتكم مقابر إن الشيطان ينفر من البيت الذي تقرأ فيه سورة البقرة ” .
Chapter : The Book of Prayer (Travellers) – كتاب صلاة المسافرين وقصرها