Sahih al-Bukhari 3228
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
إِذَا قَالَ الإِمَامُ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ. فَقُولُوا اللَّهُمَّ رَبَّنَا لَكَ الْحَمْدُ، فَإِنَّهُ مَنْ وَافَقَ قَوْلُهُ قَوْلَ الْمَلاَئِكَةِ، غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ "
Narrated Abu Huraira:
Allah's Messenger (ﷺ) said, "When the Imam, during the prayer, says, "Allah hears him who praises Him', say: 'O Allah! Our Lord! All the praises are for You/, for if the saying of anyone of you coincides with the saying of the angels, his past sins will be forgiven."
Full reference and source
Sahih al-Bukhari 3228 In-book : Book 59, Hadith 39 USC-MSA web (English) : Vol. 4, Book 54, Hadith 451 (deprecated)
View source on Sunnah.com (opens in a new tab)