>>12142634This is provably impossible using graph theory. We can show this by depicting the 5 rooms + the 1 space outside as 6 nodes (shown in blue), and the doors between them as black lines. The white number on each node indicates the number of doors connected to it.
When you arrive in a room by one door, you must leave using a different door. This means the number of doors connecting to a room must be even, unless it is the room you started in or the room you end in. Since more than 2 nodes have an odd number of doors, the problem is unsolvable.