It doesn’t sound like the boyfriend or your husband are particularly good for you or your children. It seems to me that you moving out for five months was a great choice and I think your husband is cruel for not allowing you more access to your children.
My sensible head tells me you should focus on being alone and becoming the best you can be for your kids. However, I need to heed this advice myself too and am failing. I can fully appreciate how difficult it is to move on from relationships and how easy it is to become trapped in a relationship that is unhealthy for you. So, instead, I will suggest that you just keep your head held high and look after yourself. Take every day as it comes and try not to dwell on the past x