This is a matter related to the issue of combining two prayers and is a branch of the issue of the intention for combining two prayers.
Firstly, I would like to remind everyone of what I previously mentioned about the opinions of the scholars regarding combining two prayers. The Ḥanafiys only allow combining two prayers at ʽArafāt and Muzdalifah, while the Ḥanbaliys permit it even without a valid reason, and the Shāfiʽiys and Mālikiys permit it with some conditions.
Secondly, the scholars have stipulated that for delayed combining of two prayers, the intention for combining must be made in advance, subject to two conditions: (1) the intention must be made during the time of the first prayer, not during the time of making up the prayer, and (2) there must be enough time to perform the first prayer. Therefore, if someone leaves their home before Dhuhr prayer and has not yet prayed it, they can combine it with ʽAṣr prayer as long as the time for Dhuhr prayer has not run out, which is estimated as twenty minutes before calling out the ʼAdhān for ʽAṣr prayer. If the time for Dhuhr prayer has run out, then they must make the missed prayer of Dhuhr up separately. This is the opinion of the Shāfiʽiys and Ḥanbaliys.
Thirdly, regarding advanced combining of two prayers, the Shāfiʽiys and Ḥanbaliys have also stipulated the requirement of making the intention for combining the two prayers in advance before performing the first prayer, just as they have stipulated the requirement of continuity between the two prayers. However, Ibn Taymiyah argued that making the intention in advance is not obligatory, and it is permissible to make the intention for combining the two prayers after performing the first prayer, but before performing the second prayer, as long as there is a gap between the two prayers and the time for the second prayer has not yet begun.
After all, Allāh knows best.
Fatwa by Dr. Khālid Naṣr