Sunan an-Nasa'i #1063
The Book of The At-Tatbiq (Clasping One's Hands Together) 12:35
It was narrated from Abu Hurairah that:
The Messenger of Allah (ﷺ) said: "When the Imam says: 'Sami Allahu liman hamidah (Allah hears the one who praises Him),' then say: 'Rabbana wa lakal-hamd,' (Our Lord, and to You be the praise).' Whoever says that and it coincides with the angels saying it, his previous sins will be forgiven."