The waiting period of a woman, who is divorced by her husband, after remarrying is called Iddah.
Allah the Almighty commands:
“Divorced women shall wait by themselves for three clean periods. (…)” (Al-Baqara/The Cow 2:228)
Since sexual intercourse is forbidden in menstruation period, a woman is already by herself. As long as she will share the same house with her husband during the iddah, this period here is the clean period of a woman in which she is able to have intercourse with her husband.
According to this, women divorced by their husbands shall wait without an intercourse for three clean periods. Because there can be no divorce in menstruation period, the time a divorced woman shall spend with her husband without intercourse is 3 menstruation + 3 clean periods which is approximately 3 months total. After ending of the 3rd clean period, the woman becomes fully divorced and she can remarry to another man thereafter.
Marriages which are performed before the waiting period is over are illegal and void.
Allah commands about the waiting period of women who doesn’t have menstruation period or pregnant women as follows:
“For those of your women who have lost expectation of menstruation, their waiting period is three months. The same also applies to those who don’t have menstruation at all. As for pregnant women, their waiting period ends with the delivery of their burden. Allah will create ease for those who fear from Him.” (At-Talaq/The Divorce 65:4)
Men can divorce their wives anytime whom are in one of these conditions. Their waiting period starts right after the divorce.