He divorced her three times and she wants to marry a man who is on his deathbed so that she can go back to the first husband
Question

I asked a scholar he said we are irrevocably divorce. Now I want marry her again.
She wants to marry a man (unable to have sexual relation) who is terminally ill and will die in few days (according to doctors advice). In order for me to remarry her. So، She may pay the man on his deathbed to marry her. If He dies will she be halal for me to marry?.
Praise be to Allah.If a man divorces his wife three times, she is not permissible for him until she has been married to another husband, because Allah, may He be exalted, says (interpretation of the meaning):
“And if he has divorced her (the third time), then she is not lawful unto him thereafter until she has married another husband. Then, if the other husband divorces her, it is no sin on both of them that they reunite, provided they feel that they can keep the limits ordained by Allâh. These are the limits of Allâh, which He makes plain for the people who have knowledge”
[al-Baqarah 2:230]. 
And it is essential that the second husband have intercourse with her; if no intercourse takes place between them, she does not become permissible for the first husband. 
The scholars are unanimously agreed on that, and the evidence for that from the Sunnah is the report narrated by al-Bukhaari (2639) and Muslim (1433) from ‘Aa’ishah (may Allah be pleased with her), that Rifaa‘ah divorced his wife for the third time, and after that she married ‘Abd al-Rahmaan ibn al-Zubayr, and claimed that he had not consummated the marriage with her and she wanted to get divorced from him and go back to her first husband. The Messenger (blessings and peace of Allah be upon him) said: “Do you want to go back to Rifaa‘ah? No, not until you taste his (‘Abd al-Rahmaan’s) sweetness and he tastes your sweetness.” 
Al-Nawawi (may Allah have mercy on him) said: 
The words of the Prophet (blessings and peace of Allah be upon him), “not until you taste his sweetness and he tastes your sweetness” are a metaphor for intercourse, likening its pleasure to the sweetness of honey. 
In this hadeeth we see that the woman who has been divorced three times is not permissible for the one who divorced her until she has been married to another husband, and he has intercourse with her, then he divorces her and her ‘iddah comes to an end. As for merely doing the marriage contract with her, that does not make her permissible for the first husband. This is the view of all the scholars among the Sahaabah and Taabi‘een and those who came after them, except Sa‘eed ibn al-Musayyib; perhaps this hadeeth did not reach him. End quote. 
Ibn Qudaamah (may Allah have mercy on him) said: 
After the Prophet (blessings and peace of Allah be upon him) clearly explained what was meant in the Book of Allah, may He be exalted, and that she is not permissible for the first husband until the second husband tastes her sweetness and she tastes his sweetness, no differing view should be given any consideration and it is not permissible for anyone to follow a different view.
End quote from al-Mughni, 10/549 
If there is an agreement with the second husband that he will marry her in order to make her permissible for her first husband, or if the second husband intends that without any prior agreement with anyone, and he does not want to marry her (except for this purpose) or stay with her, then this is a tahleel marriage, and the Messenger of Allah (sa) cursed the one who does that. The woman does not become permissible to her first husband by means of this haraam marriage, even if the second husband has intercourse with her. 
Ibn Qudaamah (may Allah have mercy on him) said: 
Tahleel marriage is haraam and is invalid according to most scholars. … If it is stipulated that it is tahleel before the marriage contract is done, but it is not mentioned in the marriage contract, or he intended it as a tahleel marriage without that being stipulated, then the marriage is also invalid.
End quote from al-Mughni, 10/49-51 
If the intention is on the part of the woman only, and no agreement to that effect was made with the second husband and he did not intend it to be a tahleel marriage, then the marriage is valid and she becomes permissible thereby for the first husband, if the second husband consummates the marriage with her then divorces her or dies, and the woman’s intention does not have any effect on that. 
This has been explained in the answer to question no. 159041. 
But the fact that she is giving money to this man so that he will agree to this marriage contract indicates that he is aware of the intention of tahleel and that he does not want to marry her at all, so by accepting that he is like a borrowed billy-goat, who comes between the divorced spouses to make her permissible for her first husband. 
See also the answer to question no. 76324. 
And Allah knows best.