All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
First of all, a Muslim layman is obliged to seek the knowledge that he needs for his acts of worship which Allaah had ordained on him so that he would worship Allaah with insight and comply with the saying of the Prophet : ''Seeking knowledge is obligatory upon every Muslim." [Ibn Maajah]
One resorts to Taqleed (following or imitating a certain school or Imaam) in case of necessity but this is not the principle that a Muslim is required to abide by. For more benefit, please refer to Fatwa 90479.
As regards your question how a layman would know if this scholar is pious…, then the answer is that there are in the Muslim nation prominent scholars who are trustworthy in regard to their knowledge and religion and a layman or a student of knowledge knows about them like the four Imaams and other scholars like them and the scholars whose names are well-known among the general public. So, if a layman is absolutely ignorant to an extent that he does not know about these scholars, then he should ask those whom he trusts about their religion so that they would inform him about a scholar whom he would follow.
As regards the comparison between contemporary and earlier scholars, and whom one should follow, then a layman should follow a scholar whom he believes to be more trustworthy and more knowledgeable whether this scholar is a contemporary scholar or an earlier scholar, and he may have to follow the contemporary scholars in regard to new matters that did not exist before and the former scholars did not speak about it.
With regard to what you mentioned regarding raising the hands and following the School of Abu Haneefah, then first it should be mentioned that raising the hands whether in Takbeeratul Ihraam (saying Allaahu Akbar when starting the prayer) or during the prayer is a recommended Sunnah and not an obligation. There is a consensus among the scholars that it is recommended.
If we assume that a person advises that layman to raise his hands when bowing down (Rukoo’) and when standing up from Rukoo’, that this is the Sunnah, so if that person is sincere in not having enough knowledge to distinguish between what is preponderant and what is less preponderant, then it is permissible for him to imitate Imaam Abu Haneefah whom he considers in his opinion to be the most knowledgeable and the most trustworthy, so he is forgiven in imitating him but there is no doubt that he will remain in his ignorance because it might be that the issue in which he imitated the Imaam is an issue in which the Imaam was wrong.
For more benefit, please refer to Fataawa 173959 and 92492.
Allaah Knows best.