As is often the case when a learner asks 'Which one is correct?', the answer is : 'Both! They are both correct, but you use them in different contexts. It all depends what you want to say!' [See Phil's Discussion about the Binary approach to language learning).
Let's take a look at your tenses:
If you have two past simple tenses - such as 'did not see' and 'hid' - it suggests that there are two actions which happened sequentially, often with one being a reaction to the other. So, if you say, 'She didn't see me because I hid behind a tree', this puts the emphasis on your action of running to hide behind a tree. We'd understand that you were perhaps alone in a garden to start with. But WHEN you saw the other person come into the garden, you THEN went to hide yourself behind a tree.
However, if you have a past simple tense ('did not see' )along with a past continuous tense (' I was hiding'), this emphasises your position behind the tree and - most importantly - the fact that you were already hiding behind the tree BEFORE the other person entered the garden. We use past continuous to describe a situation or activity which was ALREADY IN PROGRESS at the time when the other action occurred, and possibly continued after it.