1. when I was passing the street, I saw Emily.
2. when I saw Emily, I was passing the street.
In one, you are explaining what happened WHEN you were passing the street. (ie. you saw Emily)
In two, you are describing WHAT you were doing (ie passing the street) when you saw Emily.
1. When I had seen Emily, I passed the street.
2. When I passed the street, I had seen Emily.
In one, you are describing WHAT you had done when you had seen Emily. (you passed the street).
In two, you are describing who you saw WHEN you passed the street (you saw Emily)