In a nutshell...
The enemy gets to make their attack(s) before the Scout can use Skirmisher and move away.
In D&D 5e there are generally 5 steps when it comes to combat and are the following:
1) Determine Surprise
2) Establish positions
3) Roll Initiative
4) Take turns
5) Repeat step 4 until the fighting stops.
We will be focusing on ...
The enemy must actually fully end its turn there
The Scout Rogue's Skirmisher feature states:
You can move up to half your speed as a reaction when an enemy ends its turn within 5 feet of you. This movement doesn't provoke opportunity attacks.
The section on "The Order of Combat" states:
4. Take turns. Each participant in the battle takes a turn in ...