Choose when or while.
I was having lunch when/while James arrived.
When/While I heard the doorbell, I went to the door.
When/While Jo was washing her hair, I did my homework.
When/While you saw Ann, was she with Sam?
I was in the shop when/while
someone stole my bag.
When/While we were standing outside the cinema, someone picked my pocket.