There are 3 basic different ways to say "when" in japanese:
〜と, to indicate that an action brings about a natural consequence.
このつまみを回すと、音が大きくなります。
When you turn the knob, the volume turns up.
〜たら, to indicate that something happens after another action.
うちへ帰ったら、シャワーを浴びます。
When (or as soon as) I go back home, I take a shower.
〜とき is used to mark the moment, in general.
うちへ帰るとき、友達に会いました。
When I was returning home, I met a friend.
So the best way to phrase your sentence, in my opinion, is:
目が覚めたら、みんな まだ寝ていた。
When I woke up, everybody was still sleeping.