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, we do not understand what you mean by your statement ‘if Allaah allows it’; it might be that you mean what you mentioned at the end of the question that you want to leave your husband so that he might live with his first wife. So if you mean by this asking for divorce, then a wife is not allowed to ask for divorce unless she has a sound reason. But if you fear any harm by him keeping both of you in the same house, then you are permitted to ask for divorce due to the harm. For more benefit, please refer to Fatwa 88408.
However, if you can be patient with him and stay with him, then you should do so because the benefit might not be in divorce.
As regards the legal [fake] divorce, then we have already clarified that one should not resort to it due to some prohibitions; for more benefit in this regard, please refer to Fataawa 89514 and 105113.
As regards him keeping both of you in one house, then this is not permissible except with the consent of both of you. However, if the house is big in a way that he can allocate a part of it with its separate amenities to each one of you, then he is allowed to do so.
For more benefit, please refer to Fataawa 86818, 90132 and 91150.
Allaah Knows best.