Praise be to Allah.
There is a difference of scholarly opinion concerning the length of ‘iddah following khula‘. What we state in our fatwas on this website is that it is one menstrual cycle, as explained previously in the answer to question no. 5163
If the woman menstruates following khula‘ then becomes pure, then her ‘iddah has ended and it is permissible for her to get married; she does not have to complete three months or three menstrual cycles according to this opinion.
It is not permissible for the woman to get married during the ‘iddah at all, not under any circumstances, whether the husband consummates the marriage with her or not. If this marriage contract is done, then it is invalid and haraam, because Allah, may He be exalted, says (interpretation of the meaning):
“… nor resolve on the tie of marriage till the term prescribed is fulfilled.”
i.e., do not do the marriage contract with a woman who is observing ‘iddah until her ‘iddah has ended.
Ibn Katheer said: The scholars are unanimously agreed that the marriage contract during the ‘iddah is not valid.
End quote from Tafseer Ibn Katheer, 1/640
Ibn Qudaamah said: If (a man) marries a woman who is still observing ‘iddah, and they are both aware of the ‘iddah and the prohibition on marrying during the ‘iddah, and he has intercourse with her, then they are zaanis (fornicators).
End quote from al-Mughni, 8/127
The basic principle is that the woman who is irrevocably divorced or separated by means of khula‘ should observe ‘iddah in her family’s house. If that is not possible, then she may spend the ‘iddah period in any accommodation where she will be safe.
If her (ex-)husband gives her permission to stay in their marital home until the ‘iddah ends, there is nothing wrong with her staying there, on condition that she is safe from him and has accommodation that is completely separate from him.
Ibn Qudaamah said: The woman who is irrevocably separated by means of annulment or divorce (talaaq) may observe the ‘iddah wherever she wants.
End quote from al-Kaafi, 3/207
And Allah knows best.