He acquired unlawful wealth and bought an apartment with it. Does he have to get rid of it?
Question

I was working in a job before I got married, in which I earned some money in a way that was not halaal. After some time, I accumulated enough money and bought an apartment with it, as well as a half share in a taxi. This is all that I own. After I got married, I promised Allah that no haraam wealth would enter my house. I left that job and repented. What should I do with the apartment and the car? I want to purify my house and my wealth of anything that is of haraam provenance. What should I do so that Allah will be pleased with me and turn to me in mercy?
Praise be to Allah.Firstly:
We ask Allah, may He be exalted, to accept your repentance and to bless you with lawful, halaal provision.
You should understand that one of the conditions of repentance is righting the wrongs that were done to people. So if any of this money was taken without the consent of its owner, such as by stealing, deceiving or cheating, then you must return the money to its owners. If there is no way to reach them or their heirs after trying hard to find them, then you must give it in charity with the intention that the reward be for them. Then if its owner comes along some day, you should give him the choice between having the money returned to him, in which case the reward for the charity will be yours, or approving of the act of charity and the reward will be his.
Secondly:
If you received the haraam wealth in return for haraam transactions or work, by mutual consent, such as the price of alcohol, or payment for singing, playing musical instruments, fortune-telling, recording of riba, bearing false witness or other prohibited actions, then the matter is subject to further discussion:
a.. Whatever a person earned of such money when he was unaware of the prohibition on it, he may keep it and he is not obliged to get rid of it, because Allah, may He be exalted, said regarding riba, after revealing the prohibition on it (interpretation of the meaning):
{So whoever has received an admonition from his Lord and desists may have what is past, and his affair rests with Allah. But whoever returns to [dealing in interest or usury] - those are the companions of the Fire; they will abide eternally therein} [al-Baqarah 2:275].
b.. If he was aware that this money is haraam, but he spent it and it has gone, then if he repents, he does not have to do anything else.
c.. If the money is still there, then he must get rid of it by spending it on charitable causes, unless he needs it, in which case he may keep as much as he needs, and get rid of the rest.
The scholars of the Permanent Committee for Ifta’ were asked:
I want to ask you about a fatwa from one of the scholars that is widely known among the people. It says that if a person earned money from making alcohol or selling it, or selling drugs, and he repents to Allah, may He be glorified and exalted, then this money that he earned by making alcohol or selling it, or selling and promoting drugs is permissible (for him to keep).
They replied: If at the time when he earned the money he was aware that it is haraam, then it does not become permissible for him (to keep it) as a result of repenting. Rather he must get rid of it by spending it on charitable causes and good works." (Fataawa al-Lajnah ad-Daa’imah  14/33).
Ibn al-Qayyim said: If someone is involved in an unlawful transaction and he receives money as a result, as in the case of a prostitute, a singer, a seller of alcohol, one who bears false witness, and the like, then he repents and still has that money in his possession, then one group of scholars said that he should return it to its owner, because it belongs to that person, and he did not receive it with the permission of the Lawgiver and its owner did not get any permissible benefit from him in return for it.
Another group of scholars said: Rather his repentance involves giving it in charity and not giving it to the one from whom he took it. This is the view favoured by Shaykh al-Islam Ibn Taymiyah, and it is the more correct of the two views." (Madaarij as-Saalikeen 1/389).
Ibn al-Qayyim discussed this matter at length in Zaad al-Ma‘aad (5/778), where he confirmed that the only way to get rid of this money and perfect one’s repentance is by giving it in charity. But if he needs it, he may take as much as he needs, and give the rest in charity. End quote.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: If this prostitute and this wine seller have repented, and they are poor, it is permissible to give them as much as they need from this money, but if he is able to engage in trade or do some craft such as weaving and spinning, he may be given enough to form capital [to set up in such a business]. End quote from Majmoo‘ al-Fataawa (29/308).
Based on that, if you need the apartment and your share of the taxi, then we hope that Allah will pardon you, and you do not have to get rid of any of that.
But you must strive hard to do righteous deeds and give a lot of charity, for Allah, may He be exalted, says (interpretation of the meaning):
{But indeed, I am the Perpetual Forgiver of whoever repents and believes and does righteousness and then continues in guidance} [Taa-Haa 20:82].
And Allah knows best.