This is a practical oversimplification which will be right most of the time. For more detailed information see Mastery of the Tenses!
"was doing" / "were doing"
For unfinished past actions
- I was working on my thesis when I met you.
- I saw that you were waiting at the bus stop.
- I wanted to know what they were doing.
For past activities at a specific time in the past (especially when the action is longer than the time)
- When you arrived I was cooking.
- I was working at 11am.
- The sun was shining and the birds were singing.
For actions that were interrupted by another
- The phone rang while I was cooking.
- The cat ran across me as I was driving.