(while, waiting, I was) for the bus, it began to rain.
while I was waiting
When i went out, it was dark.
It was dark when i went out.
When you’re tired, don’t drive.
Don’t drive when you’re tired.
Ann was very happy when she passed the examination.
When ann passed the examination, she was very happy.
Always look both ways when you cross the road.
Before you cross the road, always look both ways.
While i was waiting for the bus, it began to rain.
It began to rain while i was waiting for the bus.