All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger.
In regard to the first divorce, the matter is clear and divorce had taken place. As regards the second divorce, if it was after you took your wife back during her waiting period, then divorce had also taken place. The same applies if she was in her waiting period from the first divorce, because a revocably divorced woman (in her waiting period) takes the ruling of a wife and so divorcing her is considered as a valid divorce.
Concerning having sexual intercourse with her after the second divorce, if this happened during her waiting period, then by having sexual intercourse with the wife, you are considered as having taken her back according to the Hanafi, Maaliki and Hanbali Schools of jurisprudence, however, the Maaliki School of jurisprudence conditioned that the husband must have the intention of taking her back. Based on the opinion that by having sexual intercourse with the wife she is taken back, then you are considered as having taken her back. In this case, then you had initiated a third divorce to her while she was your wife, so this divorce takes place as well.
On the other hand, if we presume that you had not taken her back, and you divorced your wife while she was pregnant, then she was still in her waiting period, because the waiting period of a pregnant woman ends by her giving birth to the baby, in which case, this divorce took place. Therefore, your wife had become permanently forbidden for you and you are not permitted to take her back until she marries another man a genuine marriage and he consummates the marriage with her and then he divorces her or dies.
However, if you uttered the word divorce after she gave birth to the child, then in this case she is not considered your wife and so the divorce does not take place. However, you cannot take her back except with a new contract.
Nonetheless, we advise you not to rely on this Fatwa or on the Fatwa of the Shaykh whom you mentioned in the question because one cannot know all the circumstances and conditions in which such a divorce was initiated except by presenting your case orally (in person) to the scholars, so we advise you to consult trustworthy people in the country where you live.
Allaah Knows best.