The Messenger of Allah ﷺ said, "Fast when you see it and break your fast when you see it. If clouds obscure it from your view, complete the count of thirty days, and do not anticipate the month by fasting in advance."
أخبرنا إسحق بن إبراهيم قال حدثنا إسمعيل بن إبراهيم قال حدثنا حاتم بن أبي صغيرة عن سماك بن حرب عن عكرمة قال
عن رسول الله ﷺ قال صوموا لرؤيته وأفطروا لرؤيته فإن حال بينكم وبينه سحاب فأكملوا العدة ولا تستقبلوا الشهر استقبالا
Its chain of transmission is daif. Abu Dawud narrated it in the book of Fasting, chapter "Whoever said, if it is obscured from you, then fast thirty days," hadith no. 2327, from the hadith of Simak, through him. It is also in al-Kubra, hadith no. 2439, and Tirmidhi graded it sahih, see hadith no. 326.