The Messenger of Allah ﷺ said, "Do not fast before Ramadan. Fast when you see the new moon and break your fast when you see it. If clouds obscure it, complete thirty days."
حدثنا قتيبة حدثنا أبو الأحوص عن سماك بن حرب عن عكرمة
قال رسول الله ﷺ لا تصوموا قبل رمضان صوموا لرؤيته وأفطروا لرؤيته فإن حالت دونه غياية فأكملوا ثلاثين يوما
[Sahih]. Abu Dawud also narrated it in the Book of Fasting, chapter on "Whoever said, if it is obscured from you, then fast thirty days," hadith no. 2327, from the hadith of Simak, and its chain is daif, but the hadith has sahih corroborating narrations.On this subject there are also narrations from Abu Hurairah [Bukhari, no. 1909, and Muslim, no. 1081], Abu Bakra [Bukhari, no. 1912, and Muslim, no. 1089, with a different wording], and Ibn Umar [Bukhari, no. 1906, and Muslim, no. 1080].