Sahih al-Bukhari, Hadith 3228

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."

حَدَّثَنَا إِسْمَاعِيلُ، قَالَ حَدَّثَنِي مَالِكٌ، عَنْ سُمَىٍّ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ ـ رضى الله عنه ـ أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏ "‏ إِذَا قَالَ الإِمَامُ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ‏.‏ فَقُولُوا اللَّهُمَّ رَبَّنَا لَكَ الْحَمْدُ، فَإِنَّهُ مَنْ وَافَقَ قَوْلُهُ قَوْلَ الْمَلاَئِكَةِ، غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ ‏" ‏‏.‏

sunnah.com