He thought about divorcing his wife and uttered the words to himself in a low voice
Firstly:
In the case of clear divorce, such as when a man says “You are divorced” or “My wife is divorced” it is not essential that there be the intention of divorce. It counts as such even if one did not intend it, but it is essential that the person should intend to utter the words and understand the meaning of them. Hence if one who is asleep or who utters the word of divorce absentmindedly, without intending to utter them, his divorce does not count as such. The same applies if a non-Arabic-speaker utters the word of divorce (talaaq) without knowing its meaning – it does not count as a divorce.
Based on this, what you have mentioned about your imagining a meeting with your family and issuing a divorce to her twice, and this happening three or four times, and your saying that in a low voice, does not count as divorce, because it was either something that you thought of to yourself, which is forgiven, or you did not intend to utter the word of divorce and make it happen at that moment, and you were only thinking of what would happen in the future, but you did not want to issue a divorce at that moment, especially since you mentioned that you suffer from lack of concentration and absentmindedness, and that when you are worried about something you talk about it to yourself, and that may be in a loud voice.
With regard to your divorcing her when she was menstruating, this is a haraam divorce according to scholarly consensus; you have to repent from it and resolve not to do it again. If you consulted a scholar at that time to ask whether it counted as divorce or not, you should follow the fatwa he gave you.
And Allaah knows best.