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.
It is permissible to pray in a two [or more] storey mosque if the praying people can follow the Imam by seeing him or listening to his Takbeer. Al-Buhooti said: "It is valid for a person led in prayer to follow the Imaam even if he cannot see him nor see those praying in rows behind him provided he can hear his Takbeer."
This is the opinion of Imam Ash-Shaafi'i and Imam Ahmed according to a narration of him.
Imam An-Nawawi said: "There are three cases for the Imaam and the person led in prayer:
1- If the Imaam and the person led in prayer are in the same mosque then it is allowed for the latter to follow the Imaam regardless of the distance between them (short or long) due to the width of the mosque, and regardless of whether it is in the same building or in another place affiliated to the mosque, like the courtyard of the mosque, the basement, and the covering of the and its court, and the minaret which is part of the mosque. The prayer in all the above cases and similar ones is valid if the person led in prayer realizes the prayer of the Imam and does not precede him. His prayer is valid whether he is above the Imaam or on the same level with him or below him. There is no disagrerement over this opinion."
Ibn Qudamah said: "Since the person led in prayer was able to follow the Imam, then his prayer is valid even if he cannot see him, just like the blind man. Seeing the Imam is intended to know in which position the Imam is, and knowing this is possible by hearing hisTakbeer, so this is like seeing him."
Imam Ibn Taymiyyah also permitted following the Imaam in the mosque even if he cannot see him or see those who are led behind him in prayer, contrarily to what you mentioned about him in your question.
It is reported in Majmou Al-Fatawa that Ibn Taymiyyah was questioned about a person who follows an Imaam from behind a barrier and he can neither see the Imaam nor those who follow him; and he replied: "Praise be to Allaah, his prayer is valid according to the most scholars and it is clearly narrated from Imam Ahmad that he said that following from behind the pulpit is allowed. The Sunnah as far as rows are concerned is to complete the front row, then the ones after it and stand close together. If one offers the prayer in the last part of the mosque while there is a place behind the Imaam, his prayer is dislikable."
If a person led in prayer is outside the mosque, the rows should be continuous so that he can see the Imaam or see the people who are led in prayer behind the Imaam.
Allaah knows best.