Let's say that an enemy goblin is escaping from battle and a ranged Ranger wants to stop him without killing him (e.g. by hitting him to the leg). How is this managed? I am interested both in the case the enemy has enough HP to survive the hit, and the case the hit would normally kill the enemy.
TL;DR It Never Hurts to Ask
The Goblin Is Not Required to Die at 0 HP, even though most do
MM p. 7
A monster usually dies or is destroyed when it drops to 0 hit points.
PHB p. 198
Most DMs have a monster die the instant it drops to 0 hit points, rather than having it fall unconscious and make death saving throws. Mighty villains and special nonplayer characters are common exceptions; the DM might have them fall unconscious and follow the same rules as player characters.
- For the case where the goblin isn't reduced to 0 HP, this edition isn't that granular in combat mechanics. Any creature with > 0 HP functions fully until that 0 HP mark is reached. (See below for asking anyway, and a good use of inspiration if that's being used at your table). Since HPs are an abstraction, note that PCs by these rules don't get weaker the closer they get to 0 HP. Most rulings would be "the goblin's hit, and he keeps running."
At 0 HP: the goblin isn't required to die at 0 HP. In a given situation, this monster/NPC could be treated as a PC is, but the player needs to make clear to the DM what he's trying to do. If the DM agrees/rules favorably, there are a variety of ways to keep the goblin alive once you bring him down. Depending upon your party make up, you can attempt to
- use a healing spell,
- use a healer kit,
- cast the Spare the Dying cantrip,
- a healing potion,
- attempt to stabilize the goblin (PHB p.197).
Depending on the methods available and attempted, the DM may need to roll a death save or two on the goblin's behalf to see if these attempts are successful.
The main reason monsters just die at 0HP is because it's more to keep track of and is almost always unnecessary. There is a reason for the goblin to not die immediately, so the death save / Spare The Dying mechanic has a point here. Declaring "I want to interrogate, or revive, that goblin" makes that enemy "special".
Declaring "I want to stabilize that goblin and keep him from dying" after bringing him down with the bow shot is a valid player attempt. It has rules support in this edition. The "called shot" doesn't have explicit rules support in this edition, but the DM can still support a called shot.
The DM can rule in favor of a called shot as you described it. It never hurts to ask. DM will likely either assign disadvantage or make other modifications to the attempt since it's a harder shot than the regular attack with a ranged weapon. He could have you use a DM assigned inspiration point that was previously earned (DMG p. 240-241) for the attempt. He could apply the "rule of cool."
Is a DM required to allow any of that? No, but the basics of the game provide a solid premise for this to work. (It never hurts to try!). I'll predict that most DM's would support the attempt, as it fits very well into the fundamentals of how the game is played: (PHB p. 6)
- The DM Describes the Environment: "Your arrow hit the Goblin and he goes down."
The Players describe what they want to do: "(Ranger) I want to run to the goblin and stabilize him so that he doesn't die. We need a prisoner!" (Cleric) "I intend to use my Spare the Dying cantrip on the goblin!"
- The DM narrates the results of the adventurers' actions:
- (rolls one death save) "You arrive at the goblin and he's still, not breathing. When the cleric's "Spare the Dying" cantrip goes off, you notice him begin to breath again."
- "You arrive at the goblin, and he's still. Your arrow entered in his back and came out where a goblin's heart is. Your attempts to revive him do not succeed." (Possible follow up is cleric using a healing spell, with another ruling by the DM. Success or failure?)
- "You arrive at the goblin, and he's still. Your arrow entered in his back and came out the front. Your efforts to stabilize him seem to be working, as he begins to twitch and moan when you apply the combat first aid you learned in ranger school."
- some other result
An impromptu called shot would go similarly.
- The DM Describes the Environment: "The Goblin is fleeing at top speed!"
- Player describes action "Using my long bow, I shoot to wound/disable. Trying to hit him in the leg/knee." (Possibly adding "Going to burn that inspiration point I earned earlier.")
- The DM narrates the results of the adventurers' actions: "Roll your attack with disadvantage." or "Using that inspiration point, make the attack to kneecap him with your usual attack, as it overcomes disadvantage ..." (Ranger rolls, results in hit or miss, and the game proceeds ...
While you specified a ranged attack, if your Ranger can Misty Step or otherwise close to within melee range, the melee option to knock out would apply. (PHB p. 198.)
When an attacker reduces a creature to 0 hit points with a melee attack, the attacker can knock the creature out. The attacker can make this choice the instant the damage is dealt. The creature falls unconscious and is stable.
This sort of precise shot is not part of D&D combat mechanics.
With a melee attack that reduces an opponent to 0hp you can choose to render the creature unconscious: you can then do whatever you want with their kneecaps. This option is not available for a ranged attack.
Obviously, your DM can deal with your request to "bring down the runner" however he likes: allow it, deny it, whatever.
(Practically a side-note to #4 and #6 of @KorvinStarmast's answer:)
You and/or your DM may want to consider adopting Pathfinder's optional Called Shot rules, especially the 'Leg' section, until 5e comes up with something similar (if ever.)
Do be careful, though. Even though the two systems do resemble each other and share a common ancestor, they're wildly different in a lot of aspects. Consider modifiers and effects and other game mechanics very carefully.
With an arrow
The ranger has a spell specifically for this situation; Ensnaring Strike. You can cast this as a bonus action before you launch your arrow; if you hit, you have a chance of magically restraining the goblin until you reach them. Unfortunately with a goblin (standard 7hp) even one arrow shot is likely to take it to zero HP (and the spell does damage besides), but it does give you an option for restraining it when damage doesn't outright drop it. If you plan on using this tactic often against such weak-bodied foes, you might work with your DM to see if they will allow you to shoot blunted, headless, or target arrows (suggested damage: 1+Dex mod, similar to an unarmed melee attack).
As other answers have described, you can fire a normal arrow, drop the goblin to 0 hp, and ask your DM to track death saves while you work to revive the goblin.
Without an arrow
You wrote "(e.g. by hitting him to the leg)". Note that e.g. means "for example", which might imply that you are open to stopping the goblin without killing them by means other than arrows. Perhaps you meant "i.e." (that is) rather than "e.g."? If you are willing to consider means other than combat, you will likely be running down the goblin.
Against most opponents, simply dashing toward them until they come within melee range is the simplest solution - once they are in your reach they will have to cede you either an opportunity attack when they move or your regular attack when you move, and these melee attacks can explicitly knock them out rather than kill them. Goblins, however, are a slipperier fish, due to their nimble escape feature. With a bonus disengage, they can take both a dash and disengage each turn, meaning you are unlikely to ever catch them.
If you are on open terrain, you can ask your DM to implement the optional Chase rules from the DMG, since these will be much more favorable to you. Replacing opportunity attacks with an attack upon overtaking the goblin obviates its nimble escape, while Con checks for exhaustion likely favor you (Goblin Con 10). If you do catch up you can choose to make a melee attack or grapple attack depending on which favors you more. However, if you are in terrain which provides cover, you will quickly lose line of sight on the goblin, at which point it can use its +6 Stealth to Hide. Since the Chase rules specifically remove the disengage benefits of the goblin's nimble escape feature, your DM is unlikely to allow it unless they want you to have a chance to capture the goblin, but that is true of any of these suggestions, and if this kind of NPC interaction is what they are looking for, they may be relieved that you have found a way to talk to the goblin rather than killing it.
If you do lose sight of your quarry, remember that you are a ranger, and are built to track (Wisdom (Survival)). Be patient - you will likely find them at some point. Hopefully you have either Favored Enemy (Goblin) or Natural Explorer Favored Terrain, or both in play. If not, you should have cast another ranger spell, Hunter's Mark, as a bonus action before the goblin left your sight. This should give you the magical boost you need to track them down.