The first sentence would be for an actual event, say in a story. -- yesterday, I have been looking for bread.
The second one would describe something--- I was looking for bread when I went to the store. Going to the store is the main event while looking for bread would be the description.