ok... let me start off by saying i am a rather mean hard ass mom on certain things... and let me follow that by saying that we were told to do this by a child's counselor. i even questioned if CPS ever had a reason to come to the house if we would be in trouble for this practice and was assured we wouldn't be. (Which i made her note in the file... lol.)
So, don't know if there are other people in the house or not, but turn the door knob around, so it locks from the outside, and explain to him that he either stays in the room alone and goes to sleep or you will have to lock the door. Encourage him to make a wise choice, keep with a steady time/routine, etc. When he gets out and comes out the first time explain to him that is not acceptable and then put him in the room and lock the door. It will probably set off a huge tantrum. Assure him before you close the door that you love him, he is safe, etc. but that it is his bedtime and time for mommy to have a time out (or whatever you wish to call it) and he will remain in the room. DO NOT open the door back up, etc. If you do you are feeding into the problem and it will only continue. We were told no matter how long the screaming took place to not give in. (Which was one of the hardest things i have done as a mom!) In time he will stay in the room with the door opened because he doesn't want it locked, etc.
Just my suggestion, as mean as it may sound....