(26) بَابُ مَنْ أَصَابَ ذَنْبًا دُونَ الْحَدِّ فَأَخْبَرَ الإِمَامَ فَلاَ عُقُوبَةَ عَلَيْهِ بَعْدَ التَّوْبَةِ إِذَا جَاءَ مُسْتَفْتِيًا
Narrated Abu Huraira:
A person had sexual relation with his wife in the month of Ramadan (while he was fasting), and he came to Allah's Messenger (ﷺ) seeking his verdict concerning that action. The Prophet (ﷺ) said (to him), "Can you afford to manumit a slave?" The man said, "No." The Prophet (ﷺ) said, "Canyou fast for two successive months?" He said, "No." The Prophet (ﷺ) said, "Then feed sixty poor persons."
Reference: Sahih al-Bukhari 6821
In-book reference: Book 86, Hadith 50
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 8, Book 82, Hadith 811