What to Do If Wudu Breaks during Prayer
Question

If I lose my Wudu during the prayer, should I complete the prayer? Should I complete it from where I left off or start the prayer from the beginning all over again? When should one say the Taslim - is it after the imam’s first Taslim or his second?
Praise be to Allah.What to do if wudu breaks during prayer
The one who loses his Wudu during the prayer, by passing wind or otherwise , should go and do Wudu, then come back and start the prayer from the beginning all over again, according to the more correct of the two scholarly opinions. This is the view of the Malikis, Shafa`is and Hanbalis, unlike the Hanafis and the older view of the Shafa`is. 
This applies to the one who cannot help breaking his Wudu. As for the one who breaks his Wudu deliberately, his prayer becomes invalid according to scholarly consensus. 
The evidence quoted by the majority concerning this issue is analogy. They say, Because breaking wind and the like makes Wudu invalid, so it also makes the prayer invalid, as is also the case when one breaks Wudu deliberately. 
The Hanafis quoted as evidence the Hadith of `Aishah (may Allah be pleased with her) who said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Whoever regurgitates, has a nosebleed, vomits, or emits Madhi (prostatic fluid) should stop praying, do Wudu, then resume his prayer, and whilst he is in that situation he should not speak”, but this is an inauthentic Hadith. It was narrated by Ibn Majah, 1221. Al-Busayri said in Az-Zawa’id: Its chain of narrators includes Isma`il ibn `Ayyash, who narrated from the Hijazis, but his narration from them is inauthentic. 
Al-Hafidh ibn Hajar said in At-Talkhis Al-Habir, 1/495: “More than one of the scholars criticized the report of Isma`il ibn `Ayyash from Ibn Jurayj and the report of Isma`il from the Hijazis as inauthentic. The scholars of Hadith among the companions of Ibn Jurayj differed with Ibn Hajar and they narrated it from Ibn Jurayj, from his father, from the Prophet (blessings and peace of Allah be upon him) in a Mursal report.” (See: At-Tahqiq fi Ahadith Al-Khilaf by Ibn Al-Jawzi, 1/83; Tanqih At-Tahqiq by Ibn `Abd Al-Hadi, 1/284) 
An-Nawawi (may Allah have mercy on him) said: “We have stated that our view is the correct, new one, that it is not permissible to resume (from where one left off); rather one has to start all over again. This is the view of the Companions Al-Miswar ibn Makhramah (may Allah be pleased with him). It was also the view of Malik and others. This is the correct view from the Madhhab of Ahmad. 
Abu Hanifah, Ibn Abu Layla and Al-Awza`i said: “He may continue his prayer from where he left off. This was narrated by Ibn As-Sabbagh and others from `Umar ibn Al-Khattab, `Ali and Ibn `Umar (may Allah be pleased with them). It was also narrated by Al-Bayhaqi from `Ali, Salman Al-Farisi, Ibn `Abbas, Ibn `Umar, Ibn Al-Musayyab, Abu Salamah ibn `Abd Ar-Rahman, `Ata’, Tawus, Abu Idrees Al-Khawlani, Sulayman ibn Yasar and others (may Allah be pleased with them). The author mentioned in brief the evidence for both views, but the Hadith is inauthentic. The Companions (may Allah be pleased with them) differed concerning this issue, so the matter may be resolved on the basis of analogy. And Allah knows best.” (Al-Majmu`, 4/6) (See also Al-Mughni, 1/421)
Ash-Shafa`i (may Allah have mercy on him) interpreted the reports about some of the Companions  exiting the prayer because of nosebleed, then going to do Wudu, then resuming the prayer from where they left off as referring to washing away the blood, not Wudu in the sense of ablution for prayer. 
And he (may Allah have mercy on him) said: “Rather what is meant by Wudu here, in our opinion, is washing off blood and whatever else had gotten onto the body, not Wudu for prayer. It was narrated from Ibn Mas`ud that he washed his hands after eating, then he wiped his face with his wet hands and said: This is the Wudu of one who has not broken his Wudu. This (usage of the word Wudu) is well known among the Arabs, who use the word to refer to washing some part of the body, not all the parts that should be washed in the case of Wudu for prayer.” (As-Sunan Al-Kubra, 1/143) 
Further evidence in support of the majority view is the report narrated by Abu Dawud (205) from `Ali ibn Talq (may Allah be pleased with him) who said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “If one of you breaks wind whilst praying, let him leave and do Wudu, then repeat the prayer.”
There is a difference of opinion as to the soundness of this Hadith. It was classed as authentic by Ibn Hibban and as sound by others. 
In Fatawa Al-Lajnah Ad-Da’imah there is a question about the Hadith, “Whoever breaks wind during the prayer, let him exit the prayer. If that is during a congregational prayer, let him hold his nose and leave, and do Wudu, then let him resume his prayer from where he left off, so long as he does not speak.” 
They replied: “This Hadith was classed as inauthentic by some of the leading scholars of Hadith. Hence what it indicates about the one who breaks his Wudu during the prayer exiting the prayer, then doing Wudu and coming back to complete what is left of his prayer, is not correct. Rather breaking Wudu during the prayer renders it invalid, and after doing Wudu the individual has to start the prayer all over again from the beginning, as is indicated by the Hadith of `Ali ibn Talq (may Allah be pleased with him) who said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “If one of you breaks wind whilst praying, let him leave and do Wudu, then repeat the prayer.” Narrated by Ahmad, Abu Dawud, At-Tirmidhi, An-Nasa’i and Ibn Majah; classed as authentic by Ibn Hibban.” (Fatawa Al-Lajnah Ad-Da’imah, 5/438, vol. 2)
Shaykh Ibn Baz (may Allah have mercy on him) said: “If a person loses his Wudu whilst praying, by breaking wind or having a severe nosebleed and so on, then his prayer is rendered invalid, according to the more correct of the two scholarly opinions, because the Prophet (blessings and peace of Allah be upon him) said: “If one of you breaks wind whilst praying, let him leave and do Wudu, then repeat the prayer.” (Narrated by Imam Ahmad and the authors of As-Sunan. This was also mentioned by Al-Hafidh Ibn Hajar in Al-Bulugh)
With regard to the Hadith which mentions resuming the prayer from where one left off, this is a weak Hadith, as was also explained by Al-Hafidh Ibn Hajar in Al-Bulugh.” (Fatawa Ash-Shaykh Ibn Baz, 10/159) 
When to say Taslim in prayer behind the Imam 
It is preferable for the one who is praying behind an imam not to say the Taslim after the prayer until the imam has finished the second Taslim . 
For more details, please see the following answers: 154587 , 145246 , 42 , and 20958 .
And Allah knows best.