Abu Hurairah reported,

The Messenger of Allah ﷺ said, "When the imam says, 'Allah hears whoever praises Him,' say, 'O Allah, our Lord, to You belongs all praise.' Whoever's words coincide with the words of the angels will have his past sins forgiven."

Azami 2072

Sahih

عن أبي هريرة

أن رسول الله ﷺ قال: إذا قال الإمام سمع الله لمن حمده، فقولوا: اللهم ربنا لك الحمد، فإنه من وافق قوله قول الملائكة، غفر له ما تقدم من ذنبه.

الأعظمي 2072صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Prayer
Chapter
Ruku and sujud
Section
Imam saying "Allah hears the one who praises Him"
Numbering
Jami al-Kamil 2072 (2nd edition)
Azami 2072