Assalamualaikum ustaz. If a person sees another person praying while facing the wrong qibla, how should he correct the person who is praying? Hope for an explanation.
Waalaikumussalam wrt. wbt.,
Alhamdulillah, praise and gratitude to Allah SWT for His countless blessings for us all. Praise and salutations to our beloved Prophet Muhammad PBUH, his family, companions, and all those who follow his footsteps until the Final day.
Definition of qibla
Lexically, qibla means direction (al-jihah) where we face it and according to the syarak terminology, it is understood as the Kaaba in absolution without having any other meanings. 
There is no khilaf among scholars that facing the qibla is one of the valid conditions of prayer for those who are capable. 
Facing the qibla as a valid condition of prayer
According to the evidence from the book al-Fiqh al-Manhaji, it is stated: What is meant by qibla is Kaaba, while facing qibla means the Kaaba must be in front of him. The evidence for this condition is the statement of Allah SWT:
وَمِنْ حَيْثُ خَرَجْتَ فَوَلِّ وَجْهَكَ شَطْرَ الْمَسْجِدِ الْحَرَامِ ۚ وَحَيْثُ مَا كُنتُمْ فَوَلُّوا وُجُوهَكُمْ شَطْرَهُ
“Turn your face toward al-Masjid al-Haram. And wherever you [believers] may be, turn your faces toward it,” 
Likewise, in a hadith, Rasullullah PBUH said to the person he is teaching the methodologies of prayer:
إِذَا قُمْتَ إِلَى الصَّلاَةِ فَأَسْبِغِ الْوُضُوءَ، ثُمَّ اسْتَقْبِلِ الْقِبْلَةَ فَكَبِّرْ
“When you get up to pray, perform the ablution completely, and then turn towards the Qibla and recite takbir (Allah o Akbar =Allah is the Most Great).” 
The meaning of Masjid al-Haram in the verse and the meaning of qibla in the hadith is qibla. People who want to pray regardless of whether they are near the Kaaba and can see it or far away and it is impossible to see it. A person who is near the Kaaba is obligated to face the Kaaba with certainty and those who are far away are obligated to face it following the strong guides when there isn’t any certain and accurate guide. 
Facing the Kaaba means one’s chest faces the Kaaba not the head for a person who is praying while standing and sitting; with his head and chest for a person who is praying on his side; and with his head and toes for someone who is praying in a supine position. 
For those who are far away from the Kaaba or those who are obstructed from seeing the Kaaba, it doesn’t affect their prayer if the position is a little bit to the right or left from the ain (physical matter) of the Kaaba, for it is a slight mistake as long as it doesn’t deviate away from the Kaaba direction. 
In madhhab al-Syafie, the ways to determine the Kaaba direction are arranged in four levels of priorities, which are:
- One’s own certain knowledge such as a person who can see the Kaaba itself or a blind person who touches the Kaaba.
- Information from a trustworthy knowledgeable person.
- Ijtihad such as using a compass and others.
- A person who follows (taqlid) with the ijtihad of another person. 
Correcting a person facing the wrong qibla
Coming back to the above question, we divide it into two parts:
First: Correcting verbally
In this situation, if one sees a person praying, however, he is facing the wrong qibla. Then, it is best for the person who sees it to correct the person who is praying to tell him he should turn either to the right or left and others.
This is mentioned by Imam al-Buhuti in his book: If the person praying is informed according to the ijtihad or taqlid (following) that he is wrong with certainty (by a trustworthy person), then he should follow it (turn to the new direction) and leave his previous ijtihad and taqlid. 
The act of correcting is included in the chapter on advice and guidance. Thus, if a person is incapable to correct the other person when he is praying, then he should do so after the prayer.
Second: Correcting through action
Someone can also correct another person through action and not just verbally. This is so that the person being corrected realizes that it is intended for him. In this situation, there is a need for the correction to be made through action by the person who sees it and moves or turns the person praying to the direction that he (the person not praying) is certain of.
However, if it is also an ijtihad, then he shouldn’t move the person who is praying. This is based on the Islamic legal maxim:
الاجْتِهَادُ لَا يُنْقَضُ بِالْاجْتِهَادِ
“An ijtihad doesn’t abrogate another ijtihad.”
The act of correcting through action can be analogically deduced with a hadith narrated by Ibn ‘Abbas RA. He said:
بِتُّ عِنْدَ خَالَتِي فَقَامَ النَّبِيُّ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ يُصَلِّي مِنَ اللَّيْلِ، فَقُمْتُ أُصَلِّي مَعَهُ، فَقُمْتُ عَنْ يَسَارِهِ، فَأَخَذَ بِرَأْسِي، فَأَقَامَنِي عَنْ يَمِينِهِ
“Once I passed the night in the house of my aunt Maimuna. The Prophet (ﷺ) stood for the night prayer and I joined him and stood on his left side but he drew me to his right by holding me by the head.” 
According to this hadith, we can understand that the implied meaning is that it is permissible for a person to pull or move another person who is praying with the intention of advising or guiding him to close the saf. Hence, it can be analogically deduced (qias) that an outside person can move or turn a person who is praying (with his own ijtihad) towards a certain true qibla. Implementing the same ‘illah which is to advise or guide him.
If someone sees another person praying while facing the wrong qibla and he for certain knows the right qibla, then he should correct the person praying and he (the person praying) is obligated to turn if he believes that the correction is true.
And if the correction done verbally doesn’t affect the person who is praying, then it is permissible for him to move or turn the person who is praying towards the right qibla but one must be careful as to not invalidate the prayer.
 See Mughni al-Muhtaj, 1/142
 See al-Mausu’ah al-Fiqhiyyah al-Kuwaitiyyah, 32/302
 (Surah al-Baqarah: 150)
 Narrated by al-Bukhari (5897) and Muslim (397)
 See al-Fiqh al-Manhaji, 1/127-128
 See Kasyifah al-Saja, pg. 197; al-Taqrirat al-Sadidah, pg.200
 See al-Mu`tamad fi al-Fiqh al-Syafie, 1/217
 See I`anah al-Talibin, 1/145
 See Kasyaf al-Qanna’, 1/312
 Narrated by al-Bukhari (699)