Detailed rules of divorce
It is given in Surah Baqarah:
Divorce is (revocable) two times (only). Then either retain (the wife) with honour (in marital relationship) or release her with kindness. And it is not lawful for you to take back anything of that which you have given them, unless both fear that (now by maintaining marital ties) they may not be able to observe the limits set by Allah. So if you fear that both will be unable to keep within Allah’s limits, then (in that case) there shall be no sin upon either of them if the wife (herself) may give up something as recompense to free herself (from this distressing bond). These are the limits (set) by Allah. So, do not exceed them. And those who exceed the limits prescribed by Allah, it is they who are the wrongdoers.
Then if he divorces (for the third time), she will not be lawful for him until she marries some husband other than him. But if he (the latter) also divorces her, in such case there shall be no sin on both of them (the former husband and the wife) if they return (once more to the wedlock), provided both of them (now) think that they would be able to observe the limits set by Allah. These are the limits (prescribed) by Allah which He explains to those who have knowledge.
And when you divorce the women and they reach (the completion of) their waiting period, then either retain them (in marital bond) in a graceful manner or release them nicely. But do not retain them to hurt so that you subject (them) to excesses. And he who does so wrongs his own soul. And do not make fun of Allah’s Commands. And call to mind Allah’s favour that has been (bestowed) upon you and the Book that He has sent down to you and (the pearls of) wisdom (on which He has enlightened you). He advises you (by means of this code of conduct). And fear Allah and bear in mind that Allah is indeed All-Knowing.