وَإِذَا دَخَلَ الْمُسَافِرُ فِي صَلَاةِ الْمُقِيمِ مَعَ بَقَاءِ الْوَقْتِ: أَتَمَّ الصَّلَاةَ، وَإِنْ دَخَلَ مَعَهُ فِي فَائِتَةٍ: لَمْ تَجُزْ صَلَاتُهُ خَلْفَهُ.
Translation: If a traveller joins a resident imam while the prayer time remains, the traveller completes the full prayer. If the prayer being led is missed and made up, following the resident imam is not valid in this specified case.
The ruling distinguishes a current prayer, where following the resident imam requires completion, from a missed travel obligation fixed at two rak‘ahs.