Sunan Ibn Majah, Book 5, Hadith 925 (In-Book) ⓘ
It was narrated from Anas bin Malik that the Messenger of Allah said: “When the Imam says: ‘Sami’ Allahu liman hamidah (Allah hears those who praise Him),’ say: ‘Rabbana wa lakal-hamd (O our Lord, to You is the praise).’”
حَدَّثَنَا هِشَامُ بْنُ عَمَّارٍ، حَدَّثَنَا سُفْيَانُ، عَنِ الزُّهْرِيِّ، عَنْ أَنَسِ بْنِ مَالِكٍ، . أَنَّ رَسُولَ اللَّهِ ـ صلى الله عليه وسلم ـ قَالَ " إِذَا قَالَ الإِمَامُ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ . فَقُولُوا رَبَّنَا وَلَكَ الْحَمْدُ " .
also referenced under: Hadith 876 (Reference) & Volume 2, Book 5, Hadith 876 (DarusSalam)