Answered by Shaykh Faraz Rabbani
Can three people stay in an apartment in which only two people are allowed by law?
Walaikum assalam wa rahmatullah,
If this is something that is
a) ‘effectively accepted’ by the city authorities–such that they themselves overlook it and do not enforce it–and
b) there is no established social harm in contravening this law,
then it would be permitted to have extra people to the extent established to be effectively accepted’ and not harmful.
Otherwise, it would not be permitted, as it is binding on a Muslim to obey the law of the land.
This is what major Hanafi ulema explain on similar issues.
And Allah alone gives success.
Wassalam
Faraz Rabbani