The Messenger of Allah ﷺ said, "The month is twenty-nine days. Do not fast until you see the moon, and do not break the fast until you see it. If it is obscured from you, then complete the count as thirty."The narrator said, when the twenty-ninth of Shaban came, Ibn Umar would look for the moon. If it was sighted, that was that. If it was not sighted but no clouds or haze were blocking the view, he would begin the next day not fasting. But if clouds or haze obscured the view, he would begin the day fasting.The narrator added, Ibn Umar would break the fast along with the people and would not act on this calculation of his own.
حدثنا سليمان بن داود العتكي حدثنا حماد حدثنا أيوب عن نافع
قال رسول الله ﷺ الشهر تسع وعشرون فلا تصوموا حتى تروه ولا تفطروا حتى تروه فإن غم عليكم فاقدروا له ثلاثين قال فكان ابن عمر إذا كان شعبان تسعا وعشرين نظر له فإن رئي فذاك وإن لم ير ولم يحل دون منظره سحاب ولا قترة أصبح مفطرا فإن حال دون منظره سحاب أو قترة أصبح صائما قال فكان ابن عمر يفطر مع الناس ولا يأخذ بهذا الحساب
Etc.Reference: Muslim narrated it, in the Book of Fasting, the chapter on the obligation of fasting Ramadan upon sighting the crescent moon, hadith 6/1080, from the hadith of Ayub Sakhtiyani, through him, and its chain of transmission is sahih.