Welcome to English Forums, hendy. 'When' normally occurs with simple forms; 'while' is normally used with progressive forms. Therefore: While it was raining, I came to the office.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.