Sayyiduna Abu Hurairah (may Allah be pleased with him) narrates: The Prophet Muhammad (peace and blessings be upon him) said: "When the Imam says «سَمِعَاللهُلِمَنْحَمِدَہ», then you should say, 'O Allah! O our Lord, all praise is exclusively for You.' For whoever's saying coincides with the saying of the angels, his past sins are forgiven."
Hadith Referenceصحیح ابن حبان / كتاب الصلاة / 1907
Hadith Gradingفضيلة الشيخ الإمام محمد ناصر الدين الألبانيصحيح - «صفة الصلاة»، «صحيح أبي داود» (794): ق.فضيلة الشيخ العلّامة شُعيب الأرناؤوطإسناده صحيح على شرطهما.