'As I came back/was coming back' = During my return.
'While I came/was coming back' = During my retun. 'While' is more often used with continuous tense.
When I came back from outside, found a letter lying in front of our entrance door.
- For Teachers