Sunan an-Nasa'i, Book 22, Hadith 39 (In-Book) ⓘ
It was narrated that Ribi said; "the Messenger of Allah said: "The Messenger of Allah said: 'When you see the crescent then fast, and when you see it, then stop fasting. If it is too cloudy then complete Shaban as thirty days, unless you see the crescent before that, then fast Ramadan as thirty days, unless you see the new crescent before that."'
أَخْبَرَنَا مُحَمَّدُ بْنُ حَاتِمٍ، قَالَ حَدَّثَنَا حِبَّانُ، قَالَ حَدَّثَنَا عَبْدُ اللَّهِ، عَنِ الْحَجَّاجِ بْنِ أَرْطَاةَ، عَنْ مَنْصُورٍ، عَنْ رِبْعِيٍّ، قَالَ قَالَ رَسُولُ اللَّهِ صلى الله عليه وسلم " إِذَا رَأَيْتُمُ الْهِلاَلَ فَصُومُوا وَإِذَا رَأَيْتُمُوهُ فَأَفْطِرُوا فَإِنْ غُمَّ عَلَيْكُمْ فَأَتِمُّوا شَعْبَانَ ثَلاَثِينَ إِلاَّ أَنْ تَرَوُا الْهِلاَلَ قَبْلَ ذَلِكَ ثُمَّ صُومُوا رَمَضَانَ ثَلاَثِينَ إِلاَّ أَنْ تَرَوُا الْهِلاَلَ قَبْلَ ذَلِكَ " .
also referenced under: Hadith 2128 (Reference) & Volume 3, Book 22, Hadith 2130 (DarusSalam)