Mishkat al-Masabih 826
وَعَنْ أَبِي مُوسَى الْأَشْعَرِيِّ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: إِذَا صَلَّيْتُمْ فَأَقِيمُوا صُفُوفَكُمْ ثُمَّ لِيَؤُمَّكُمْ أَحَدُكُمْ فَإِذَا كَبَّرَ فكبروا وَإِذ قَالَ (غير المغضوب عَلَيْهِم وَلَا الضَّالّين) فَقُولُوا آمِينَ يُجِبْكُمُ اللَّهُ فَإِذَا كَبَّرَ وَرَكَعَ فَكَبِّرُوا وَارْكَعُوا فَإِنَّ الْإِمَامَ يَرْكَعُ قَبْلَكُمْ وَيَرْفَعُ قبلكُمْ فَقَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «فَتِلْكَ بِتِلْكَ» قَالَ: «وَإِذَا قَالَ سَمِعَ اللَّهُ لِمَنْ حَمِدَهُ فَقُولُوا اللَّهُمَّ رَبَّنَا لَكَ الْحَمْدُ يسمع الله لكم» . رَوَاهُ مُسلم
And from Abu Musa al-Ashʿari, who said: The Messenger of Allah ﷺ said: "When you pray, straighten your rows, then let one of you lead you. When he says takbir, say takbir, and when he says: 'not of those who have earned anger, nor of those who are astray,' say: 'Amin'; Allah will answer you. When he says takbir and bows, say takbir and bow, for the imam bows before you and rises before you." The Messenger of Allah ﷺ said: "That [moment] is for that one." He said: "And when he says: 'Samiʿallahu liman hamidah,' say: 'Allahumma rabbana laka l-hamd'; Allah hears you." Reported by Muslim.