Abu Hurairah reported,

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

Nasai 1064

Sahih

أخبرنا قتيبة عن مالك عن سمي عن أبي صالح

عن أبي هريرة

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

النسائي 1064صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Nasai Sughra
Book
Placing the hands between the knees in bowing
Chapter
Our Lord, and to You is praise
Numbering
Darussalam 1064
Nasai 1064