The Messenger of Allah ﷺ used to pray two rakʿahs following every prescribed prayer, except Fajr and ‘Asr. (Using translation from Aḥmad 1226)
كَانَ رَسُولُ اللهِ ﷺ «يُصَلِّي دُبُرَ كُلِّ صَلَاةٍ مَكْتُوبَةٍ رَكْعَتَيْنِ إِلَّا الْعَصْرَ وَالصُّبْحَ»