"The Messenger of Allah said: 'Whoever follows a Janazah until it is finished, he will have two Qirats, and whoever goes back before it is finished, he will have one Qirat." (Using translation from Nasāʾī 1941)
قَالَ رَسُولُ اللهِ ﷺ «مَنْ تَبِعَ جِنَازَةً حَتَّى يَفْرُغَ مِنْهَا فَلَهُ قِيرَاطَانِ فَإِنْ رَجَعَ قَبْلَ أَنْ يَفْرُغَ مِنْهَا فَلَهُ قِيرَاطٌ»