Fleeing Combat

The world is dangerous and unpredictable, especially at low levels. Running from certain combat situations should be an option available to the players, but based on the core rule set of 5th edition D&D, this is not possible if the enemies have equivalent movement speed to your characters, which they usually do.
  Also consider: https://2e.aonprd.com/Rules.aspx?ID=1210
  During any combat encounter, the party can decide to flee at any time, as long as all PCs are in agreement, and the fleeing PCs are capable of running away (i.e. not grappled, restrained, or otherwise restricted from moving away from the enemies). When this happens, the combat ends immediately for the fleeing PCs, and two conditions are checked to see if the enemy attempts to pursue:
  1. The enemies must make a morale check, if they fail, they do not pursue and the conflict is resolved (see Morale). Keep this in mind, as it may be more strategic to attempt to damage or intimidate enemies before running. 2. The enemies must have speed equivalent to the PCs in the terrain through which the PCs are running. If they do not, the party can simply outrun them by making a constitution saving throw with a DC of 15 minus the difference in speed between enemies and PCs (a speed difference of 15ft or more guaruntees success). Any PC who fails the throw can choose to take a point of exhaustion to successfully outrun the enemies, or will suffer opportunity attacks from the enemy before having a chance to try again.
  If both conditions are met, the enemies will pursue. This begins a skill challenge, where each round consists of an attempted escape by the party, and a round of attacks from the enemies should the escape fail. For any mentions of party speed, the speed of the slowest PC must be used, unless they are being left behind, or carried.
  If the enemies have a speed greater than the PCs in the terrain they are fleeing through, the party must come up with a way to lose the enemies, perhaps by fleeing into terrain which obscures vision, performing some action to alter the speeds of themselves or their pursuers, or performing some action which will make the enemies not wish to pursue. Each failure will result in the party taking an attack of opportunity from each enemy.
  If the enemies have speed equal to the party, the party can attempt to outrun the enemy through endurance. Doing so requires a successful consitution check by each party member with a DC of 10 plus the enemies (average) constitution modifier. Party members who fail will take opportunity attacks from the enemy as they catch up.
  The party can also attempt to escape from the enemy by any reasonable means using the environment and resources available to them. Similarly to previous situations, failures on skill checks will result in the party taking opportunity attacks.
  Successfully outrunning enemies will grant half of the experience for the combat encounter.
 

Kiting

While fleeing, any party member can decide to perform a kiting maneuver to fire at enemies from range if their speed meets or exceeds the speed of the enemy in the terrain they are moving through. If the PC's speed is greater than the enemy's speed in the terrain they are moving throug, they may simply make an attack every other round while fleeing (as one round must be used to dash in order to maintain distance). If the PC's speed is equal to the enemies speed, they will take an attack every round they make a ranged attack, and the ranged attack will be at disadvantage.
  If a PC starts the fleeing sequence ahead of the party (i.e. by being already positioned ahead in the direction the party is running), they may make a number of kiting attacks equal to their advanced distance divided by double the opponents speed (rounded down).