Question
If someone wants to build a madrasah below and his own residence above it, may he do so?
Answer
الحمد لله، والصلاة والسلام علىٰ رسول الله، أما بعد!
✿ If the land of the madrasah is his own property and is not waqf, then in that case he may make his residence above the madrasah.
✿ This is because the ruling on a mosque and the ruling on a madrasah are different.
✿ The ruling on a mosque is that from the ground up to the empty space above, that is, up to the lowest heaven, it is counted as a mosque. For this reason, it is absolutely not permissible to make a residence above a mosque.
✿ But if residential quarters have been built above the land or building of a madrasah for the teachers or the administrator of the madrasah, then living in them is entirely permissible.
ھذا ما عندي والله أعلم بالصواب