how to understand the use of was and had been
Both are different forms of tenses-'was' implies simple past tense and 'had been' implies past perfect continuous tense when used with -ing verb.
I was asleep.
I had been sleeping when the noise woke me up.
If you are asking the difference between past continuous 'was + -ing verb' and past perfect continuous ' had been + -ing verb',
then it is as follows:
He was tired of exams because he was preparing hard. (he was fed up of giving exams at that time in the past because of preparation at that time )
He was tired of exams because he had been preparing hard.(he was tired of exams as he had been preparing for them over a a period of time)