You will hear native speakers say both. However, I believe B is technically correct.
I think that it's more common to say the was doing something part of the sentence first, followed by the simple past:
I was sleeping while Jack watched TV.
That sounds more natural to me.