He is not in the office most of the time, and when he does, he closes the door as if he does not want to be bothered. He is not in the office most of the time, and when he is he closes the door as if he does not want to be bothered. You have some choices as regards commas.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.