Zayd bin Khalid reported,

The Messenger of Allah ﷺ led us in the dawn prayer at Hudaybiyah following rain that had fallen during the night. When he finished, he turned to face the people and asked, "Do you know what your Lord has said?"They replied, "Allah and His Messenger know best."He said, "Allah said, 'This morning some of My servants believe in Me and others disbelieve. Whoever said, We were given rain by the grace of Allah and His mercy, he is a believer in Me and a disbeliever in the stars. But whoever said, We were given rain by such-and-such a star, he is a disbeliever in Me and a believer in the stars.'"

Muslim 231

Sahih

حدثنا يحيى بن يحيى قال قرأت على مالك عن صالح بن كيسان عن عبيد الله بن عبد الله بن عتبة

عن زيد بن خالد الجهني قال

صلى بنا رسول الله ﷺ صلاة الصبح بالحديبية في إثر السماء كانت من الليل فلما انصرف أقبل على الناس فقال هل تدرون ماذا قال ربكم قالوا الله ورسوله أعلم قال قال أصبح من عبادي مؤمن بي وكافر فأما من قال مطرنا بفضل الله ورحمته فذلك مؤمن بي كافر بالكوكب وأما من قال مطرنا بنوء كذا وكذا فذلك كافر بي مؤمن بالكوكب

مسلم 231صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Faith
Chapter
Clarification of the disbelief of one who says "We were given rain by the stars"
Numbering
Darussalam 231
Muslim 231