One day the Prophet ﷺ was sitting out in the open among the people when a man came to him and asked, "What is faith?"The Prophet ﷺ replied, "Faith is that you believe in Allah, His angels, His Book, the meeting with Him, and His messengers, and that you believe in the resurrection."The man asked, "What is Islam?"He answered, "Islam is that you worship Allah and associate nothing with Him, that you establish the prayer, that you pay the obligatory zakat, and that you fast Ramadan."The man asked, "What is excellence?"He answered, "That you worship Allah as though you see Him, for even if you do not see Him, He surely sees you."The man asked, "When is the Hour?"He said, "The one asked about it knows no more than the one asking. But I will tell you of its signs. When a slave woman gives birth to her master, and when the barefoot herdsmen of camels compete in raising tall buildings, that is among its signs. It is one of five things that none knows but Allah."Then the Prophet ﷺ recited, "Indeed, with Allah is knowledge of the Hour" [Luqman 31:34], to the end of the verse.Then the man turned and left, and the Prophet ﷺ said, "Bring him back." But they could see no one.So he said, "That was Jibreel, who came to teach the people their religion."
كان النبي ﷺ بارزا يوما للناس، فأتاه رجل فقال: ما الإيمان؟ قال: الإيمان أن تؤمن بالله، وملائكته وكتابه ولقائه، ورسله، وتؤمن بالبعث. قال: ما الإسلام؟ قال: الإسلام أن تعبد الله ولا تشرك به، وتقيم الصلاة، وتؤدي الزكاة المفروضة، وتصوم رمضان. قال: ما الإحسان؟ قال: أن تعبد الله كأنك تراه فإن لم تكن تراه فإنه يراك. قال: متى الساعة؟ قال: ما المسؤول عنها بأعلم من السائل، وسأخبرك عن أشراطها إذا ولدت الأمة ربها، وإذا تطاول رعاة الإبل البهم في البنيان، فذاك من أشراطها في خمس لا يعلمهن إلا الله، ثم تلا النبي ﷺ: {إن الله عنده علم الساعة}[سورة لقمان: ٣٤] الآية، ثم أدبر فقال: ردوه فلم يروا شيئا! فقال: هذا جبريل جاء يعلم الناس دينهم.
Bukhari related it in the Book of Iman (50), and Muslim in the Book of Iman (9), both from the hadith of Ismail bin Ibrahim bin Ulayyah, from Abu Hayan Taymi, from Abu Zura, from Abu Hurairah, and he related it, and their wording is the same.