Castling does two big things in one move: tucks your king safely behind pawns, and develops a rook to the centre.
King still on e1. Before you castle you need: knight out, bishop out, then O-O. Random pawn pushes that don't develop just delay safety.