Three men came to the houses of the wives of the Prophet ﷺ asking about the Prophet's ﷺ worship. When they were informed, they seemed to consider it little, saying, "Where do we stand compared to the Prophet ﷺ? Allah has forgiven him his past and future sins."One of them said, "As for me, I will pray the entire night forever."Another said, "I will fast every day without break."The third said, "I will keep away from women and never marry."Then the Messenger of Allah ﷺ came and said, "Are you the ones who said such and such? By Allah, I am the most fearful of Allah among you and the most mindful of Him, yet I fast and I break my fast, I pray and I sleep, and I marry women. Whoever turns away from my way is not from me."
جاء ثلاثة رهط إلى بيوت أزواج النبي ﷺ يسألون عن عبادة النبي ﷺ، فلما أخبروا كأنهم تقالوها، فقالوا: وأين نحن من النبي ﷺ؟ قد غفر الله له ما تقدم من ذنبه وما تأخر. قال أحدهم: أما أنا فأصلي الليل أبدا. وقال آخر: وأنا أصوم الدهر ولا أفطر، وقال آخر: أنا أعتزل النساء فلا أتزوج أبدا. فجاء رسول الله ﷺ فقال: أنتم الذين قلتم كذا وكذا؟ أما والله إني لأخشاكم الله وأتقاكم له، لكني أصوم وأفطر، وأصلي وأرقد، وأتزوج النساء، فمن رغب عن سنتي فليس مني.
Bukhari narrated it in the Book of Marriage (5063) via Humayd bin Abu Humayd Tawil, that he heard Anas bin Malik saying (he then mentioned it). This is his wording.Muslim narrated it in the Book of Marriage (1401) via Hammad bin Salama, from Thabit, from Anas bin Malik, with a similar meaning.