Hadithcore
Mishkat al-Masabih, 1158

Nafi‘ said that Ibn ‘Umar used to say, “If anyone prays the sunset or the morning prayer and then comes when the <i>imam</i> is praying them, he must not say them over again.” Malik transmitted it.

وَعَنْ نَافِعٍ قَالَ: إِنَّ عَبْدَ اللَّهِ بْنَ عُمَرَ كَانَ يَقُولُ: مَنْ صَلَّى الْمَغْرِبَ أَوِ الصُّبْحَ ثُمَّ أَدْرَكَهُمَا مَعَ الْإِمَامِ فَلَا يَعُدْ لَهما. رَوَاهُ مَالك

References1 variant
In-Book Reference
Book 4, Hadith 575