When I was in rehab, I had to look at the toxic relationships that contributed to my addiction, and #1 on the list was my husband at the time, who had gone right back to drugging and drinking as soon as he got out of rehab.
I had to change playmates, playgrounds, and playthings.
Going back home to the husband was not an option for me. He was also paranoid, psychotic, and violent when using.
All rehab can do is give your AH the tools for recovery. What he does with those once he is out, including staying away from the people he uses with, will be up to him.