My H also did things WAYYYYYYY out of his "normal" character...which is why I told him once when he his girls refused to speak to him "You have become the person you taught your children NOT to associate with"...it was at one of his more lucid moments and he had to admit that he taught them well!
About custody...in our agreement that I wrote up...it was stated that my S had the right to request his own visits with his dad and that they would need to be mutually agreed upon my both of us...this way if H was "out there" I would not have had to mutually agree and S would not have to make that decision.
If you go the court route with it...they will take into consideration his age and his feelings...If need be I would also point out the living arrangement of H...technically he is considered under the law homeless...if you are living with someone and not paying rent that is what it is!
You are doing good...just know and accept that you will have your "days"...stay positive, laugh often (comedie shows and movies became my life for a while), stay busy, stay focused on you and your kids...you will be fine...better then fine, actually...you will feel so much better when you work through all of this and you get to the otherside...with or without your H...you will be so much emotionally healthier!