Sahih Muslim , Book 4, Hadith 75 (In-Book) ⓘ
Abu Huraira reported: The Messenger of Allah said: When the Imam says:" Allah listens to him who praises Him." you should say:" O Allah, our Lord for Thee is the praise." for if what anyone says synchronises with what the angels say, his past sins will be forgiven.
حَدَّثَنَا يَحْيَى بْنُ يَحْيَى، قَالَ قَرَأْتُ عَلَى مَالِكٍ عَنْ سُمَىٍّ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ " إِذَا قَالَ الإِمَامُ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ . فَقُولُوا اللَّهُمَّ رَبَّنَا لَكَ الْحَمْدُ . فَإِنَّهُ مَنْ وَافَقَ قَوْلُهُ قَوْلَ الْمَلاَئِكَةِ غُفِرَ لَهُ مَا تَقَدَّمَ مِنْ ذَنْبِهِ " .
also referenced under: Hadith 409 (Reference) & Book 4, Hadith 809 (USC-MSA)