Firstly:
According to the Sunnah, the way to prostrate is that the worshipper should prostrate on the seven parts: the forehead and nose (which count as one), the two hands, the two knees and the two feet, placing the forehead and nose firmly on the ground, holding the fingers together pointing towards the qiblah, keeping the knees apart, holding the stomach in and away from the thighs, keeping the thighs away from the calves, holding the upper arms away from the sides, and making the ends of the toes point towards the qiblah.
Al-Mawsu`at al-Fiqhiyyah, 27/97.
What matters is that every limb should be separate and play its part in prostration. Al-Bukhari (828) narrated from Abu Humayd as-Sa`idi (may Allah be pleased with him) in his description of how the Prophet (blessings and peace of Allah be upon him) prayed, that when he prostrated, he placed his hands on the ground with his forearms not resting on the ground and not held close to the body.
And it was narrated that Maymunah bint al-Harith (may Allah be pleased with her) said: When the Messenger of Allah (blessings and peace of Allah be upon him) prostrated, he held his arms so far from his sides that the whiteness of his armpits could be seen from behind. Narrated by Muslim (497).
Ibn Qudamah (may Allah have mercy on him) said:
It is Sunnah to hold the upper arms away from the sides and keep the stomach away from the thighs when prostrating, because the Prophet (blessings and peace of Allah be upon him) used to do that when he prostrated.
End quote from Al-Mughni (1/306).
Ibn al-Munir (may Allah have mercy on him) said: The wisdom behind that is that each limb should look distinct from the others, so when a person prostrates, each of the several parts of the body that are involved in prostration will be separate from the others, and they will not be resting on one another when prostrating.
End quote from Fat-h al-Bari, 4/200.
Secondly:
The posture of this imam that is mentioned in the question, in which he elongates his body as if he is lying on the ground, to the extent that his stomach almost touches the ground, is an odd posture and is contrary to what is soundly narrated about how the Prophet (blessings and peace of Allah be upon him) used to prostrate. It also goes against the instruction of the Prophet (blessings and peace of Allah be upon him): “Prostrate properly.” Narrated by al-Bukhari (532) and Muslim (493).
Al-Kasani (may Allah have mercy on him) said, explaining how prostration needs to be done:
[The worshipper] should rest on his palms… And he should hold the middle part of his upper arms away from his body, because the Prophet (blessings and peace of Allah be upon him) said to Ibn `Umar: “Hold the middle part of your upper arms away from your body,” and the [word translated here as] middle part of the upper arm refers to the fleshy part thereof. And Jabir (may Allah be pleased with him) narrated that when the Prophet (blessings and peace of Allah be upon him) prostrated, he held his upper arms away from his sides to the extent that the whiteness of his armpits could be seen. And he should prostrate properly and not rest his forearms on the ground [and he quoted the hadith referred to above].
End quote from Bada’i` as-Sana’i` by al-Kasani, 1/210; it is one of the reference books of the Hanafi madhhab.
Ibn Khuzaymah (638) narrated from Rifa`ah ibn Rafi` (may Allah be pleased with him) that the Prophet (blessings and peace of Allah be upon him) said to the one who prayed badly: “Then when you prostrate, place your face and hands firmly on the ground until every part of your body settles into place.” Classed as sound (hasan) by al-Albani in Sifat as-Salah, p. 142.
And every part cannot settle into place except in the known, proper manner of prostration, and that cannot happen in this odd and disconcerting posture [that is mentioned in the question].
Shaykh Ibn `Uthaymin (may Allah have mercy on him) said:
The Prophet (blessings and peace of Allah be upon him) said: “Prostrate properly,” which means prostrating in the correct manner, not compressing yourself to the extent that the stomach touches the thighs and the thighs touch the calves, and not elongating oneself either, as some people do when they prostrate, elongating themselves to the extent that they are almost lying down; undoubtedly this comes under the heading of innovation, and it is not Sunnah. It is not narrated soundly from the Prophet (blessings and peace of Allah be upon him) or from any of his companions – as far as we know – that any of them elongated his back when prostrating; rather the back is to be elongated when bowing. As for prostration, the worshipper should hold his stomach in and not elongate himself.
End quote from Ash-Sharh al-Mumti`, 3/38.
Shaykh Bakr ibn `Abdillah Abu Zayd (may Allah have mercy on him) discussed this matter in more detail in Bayan as-Sunnah and said, describing some innovated postures in prayer:
"3.Going to extremes in stretching and elongating one’s body in prostration:
Doing the movements properly and keeping the back straight when prostrating and bowing is the practice of the Prophet (blessings and peace of Allah be upon him). What that means in terms of prostration is something in the middle between elongating oneself on the one hand and compressing oneself and bending the back on the other, which is achieved by placing the seven parts firmly on the ground, with a proper separation between the thighs and the calves, and between the stomach and the thighs, and between the upper arms and the sides, whilst not resting the forearms on the ground.
Look at how the Prophet (blessings and peace of Allah be upon him) mentioned together the instruction to prostrate properly and the prohibition on resting the forearms on the ground as a dog does.
It was narrated from Anas (may Allah be pleased with him) that the Messenger of Allah (blessings and peace of Allah be upon him) said: “Prostrate properly; no one of you should rest his forearms [on the ground] like a dog.” Narrated by al-Bukhari in his Sahih (2/302); an-Nasa’i in his Sunan, 1109".
Another version was also narrated from him: “Bow and prostrate properly; no one of you should rest his forearms [on the ground] like a dog.” Narrated by al-Bukhari, 822; an-Nasa’i, 1027; and others.
Al-Hafiz Ibn Hajar (may Allah have mercy on him) said: “Prostrate properly” means: do it correctly, and make the postures somewhere between elongating yourselves and compressing yourselves. End quote.
Moreover, Ibn Daqiq al-`Id (may Allah have mercy on him) stated that what is prohibited is to elongate oneself or compress oneself in the posture of prostration, and that does not apply to the forearms.
It is soundly narrated in the hadith of Maymunah (may Allah have mercy on her) that when the Prophet (blessings and peace of Allah be upon him) prostrated, he kept his upper arms away from his sides, and if an animal wanted to pass beneath his arms, it could do so. Narrated by Muslim and the authors of the Sunans; this version was narrated by an-Nasa’i, 1108.
Based on that:
Going to extremes in elongating one’s body when prostrating is extreme and is far removed from moderation in doing this essential part of the prayer, in which the individual is required to show a great deal of humility before his Lord and God, may He be Glorified and Exalted, because the individual is the closest he can be to his Lord when he is prostrating. Hence we are instructed to offer supplication whilst prostrating, and it is one of the circumstances in which supplication is answered. So it is important that this essential part of the prayer should be done in accordance with the Prophet’s teachings, which means that one should do it in a proper and moderate manner, without exaggeration. So it should not be done in this extreme and innovated manner, nor should one go to the other extreme and do it in a lazy manner, such as the way in which some people prostrate, with the forearms resting on the ground, the stomach resting on the thighs and the thighs resting on the calves; this is something in which a number of prohibited actions are combined.
In Sahih al-Bukhari (1/247) it is narrated in The Book of Wudu’ that Ibn `Umar (may Allah be pleased with him) said to Wasi` ibn Hibban: Perhaps you are one of those who pray with the stomach touching the ground? I said: I do not know, by Allah.
Malik said: What is meant is the one who prays and does not hold himself above the ground; rather he prostrates with his body touching the ground.
The Sunnah is to be in between the two extremes, and this is the practice of the Muslims, praise be to Allah, Lord of the Worlds. So beware of going to extremes that are not required when implementing the Sunnah.
End quote from La Jadid fi Ahkam as-Salah by Shaykh Bakr Abu Zayd (may Allah have mercy on him), 35-37.
What you must do is alert this imam to the fact that he is going against the Sunnah by doing that, for even if his prayer is valid, as mentioned in the question, praying in this odd manner is something to be denounced, for the one who is able to do that without causing turmoil or trouble in the mosque.
Thirdly:
If this imam does not stop this infraction of his, or it is not possible to advise him to stop, then if it is possible to replace him and appoint another imam instead who prays according to the Sunnah, this is the best option, so that the prayer will be done in the best and most perfect manner.
If that is not possible, and there is another mosque in which the daily prayers are done, then praying there is better, even if the imam in the mosque lets his garment come down below his ankles, or shaves his beard, for his sin is his alone, but his praying in accordance with the Sunnah will benefit him and others.
The scholars of the Permanent Committee were asked:
A fatwa has been issued by one of the senior scholars in some other country in which he said that it is not permissible to pray behind an imam who is clean-shaven. We would like you to explain to us whether this fatwa is valid or not.
The committee replied: Letting the beard grow is obligatory and shaving it is prohibited, as is proven in the authentic hadith in which the Prophet (blessings and peace of Allah be upon him) said: “Trim your moustaches and let your beards grow.” The view of Ahl as-Sunnah wal-Jama`ah is that one may pray behind anyone, righteous or evildoer, seeking to maintain harmony and unity and to ward off dispute and division. But if you can find an imam who does not shave his beard, then you should pray behind him, but if you cannot find such an imam, then you can pray behind this imam even if he is clean-shaven, and the prayer is valid. Thus it is known that the fatwa mentioned in the question is not valid.
End quote from Fatawa al-Lajnat ad-Da’imah (7/370-371).
Shaykh Ibn `Uthaymin (may Allah have mercy on him) was asked:
What is the ruling on praying behind an imam who is clean-shaven and lets his garment hang down below his ankles?
He replied: If there is an imam who is more fearing of Allah than him, then praying behind him is undoubtedly better, but if there is no such imam, or if you enter a mosque in which the one who is leading the people in prayer is this man who is clean-shaven or lets his garment hang down below his ankles, there is nothing wrong with praying behind him, because the most correct scholarly view is that it is valid for an evildoer to lead prayer, even though one who is more righteous is more deserving of leading the prayer than him.
End quote from Majmu` Fatawa Ibn `Uthaymin, 13/625.
See also the answers to questions no. 13465 and 46557.
And Allah knows best.