Sahih al-Bukhari, Book 10, Hadith 177 (Bukhari 765)

Narrated Abu Huraira:

Allah's Messenger (ﷺ) said, "Say Amen when the Imam says 'Ghairi l-maghdubi `alaihim wala d-daalleen' (not the path of those who earn Your Anger (such as Jews) nor of those who go astray (such as Christians)); all the past sins of the person whose saying (of Amin) coincides with that of the angels, will be forgiven".