well, the first thing you need to do is to walking him before he goes to bed or play with him so he feels tired...
Also, if you don't mind put his bed/crate next to your bed for the first days.. Then, put him a little bit more far from your bed until he is outside, then close the door... Also...