Nikaah in the presence of witnesses
Q: Please be aware, I know of the rule that if a man divorces his wife three separate occasions she is not halaal for him until she genuinely marries someone else and it does not work out). I got married to my ex husband in 2009, we had a child in 2011. I was very much in love with him, he prayed and still prays 5 times a day since he reverted in 2009 and is very very in Deen since) shaytaan took over me and I stopped my salaah and started sinning, I met another guy and then I asked my husband for divorce (I am aware of what I have done and ask Allah for forgiveness and how shameful this is I understand). After the divorce (3 divorces, three separate occasions), I regretted it so
much and just wanted to get back with him. However, I was with this guy and told him I do no love you and he said it does not matter, we will get married and things will get better.
He knew I did not love him, I did have feelings for him and liked him a lot as we were very close and talked everyday all day. Before I got married to him, it was in my mind that most likely it will not work out and I want to get back with my ex husband but I did not fake the nikkah because on the day of nikkah I cried and though wow I'm married and never had a doubt about my nikkah and me and him always spoke and said '' This isn't sin anymore '' A few weeks after, I saw texts and this man talking to other girls and saying rude things that he wants to sleep with them and I thought he was completely someone different. I asked him for a divorce and he gave me the divorce yesterday.
I did istikhara asking is my nikkah valid or not. Before he divorced me and sheikhs told me to ignore the dreams and the only strong feeling I got from istikhara was that It was not valid (but at the same time I got answers from some scholars and they had all told me it is valid. I am still not convinced because I have read online that any intention of marrying your ex whilst your marrying your current husband your nikkah will be invalid.
At the nikkah there was my dad, the groom, two male witnesses from his side and the Imaam. Please refer me if you can help but I would really appreciate it if you could help. Is my nikkah valid even though I had in my mind that one day I want to get back with my my ex or is it invalid?