The Prophet ﷺ said: Do not fast one day or two days just before Ramadan except in the case of a man who has been in the habit or observing a fast (on that day); and do not fast until you sight it (the moon). Then fast until you sight it. If a cloud appears on that day (i.e. 29th of Ramadan) then complete the number thirty (days) and then end the fasting: a month consists of twenty-nine days.
قَالَ رَسُولُ اللَّهِ ﷺ لاَ تُقَدِّمُوا الشَّهْرَ بِصِيَامِ يَوْمٍ وَلاَ يَوْمَيْنِ إِلاَّ أَنْ يَكُونَ شَىْءٌ يَصُومُهُ أَحَدُكُمْ وَلاَ تَصُومُوا حَتَّى تَرَوْهُ ثُمَّ صُومُوا حَتَّى تَرَوْهُ فَإِنْ حَالَ دُونَهُ غَمَامَةٌ فَأَتِمُّوا الْعِدَّةَ ثَلاَثِينَ ثُمَّ أَفْطِرُوا وَ الشَّهْرُ تِسْعٌ وَعِشْرُونَ