Riders are using their mount's movement thus they do not provoke OAs
According to the rule for opportunity attacks:
You also don't provoke an opportunity attack when you teleport or when someone or something moves you without using your movement, action, or reaction.
When mounts move, they use their own movement not that of the rider. Thus, when using a mount to move around, the rider is not using their movement, action, or reaction and thus cannot provoke opportunity attacks.
The only reason a rider can even ever be hit by an OA while using their mount's movement is because the mounted combat rules specifically allow for this:
[...] if the mount provokes an opportunity attack while you’re on it, the attacker can target you or the mount.
This rule specifically allows for an OA to be taken against a rider if the mount provokes, but does not otherwise change the rules for provoking. The rider doesn't provoke an OA even in this case, they can are only allowed to be targeted by the OA.
A rider never provokes OAs while using mounted movement. If a mount disengages, they cannot provoke OAs and neither does the rider. Thus no OAs can be taken against either.
Jeremy Crawford also agrees with this reading in a Tweet:
Q: if a mount takes the Disengage action does the rider provoke opportunity attacks? [...]
Crawford: No, since the mount isn't provoking them and the rider is being moved by someone else's movement (PH, 195).
Your example might not be possible depending on how your DM handles mounted combat turns
[C]an I ride up to an enemy, make a melee attack, then have my mount disengage and ride away, without provoking an opportunity attack?
There is quite a bit of debate on whether the rules say that a mount can act during a character's turn or not. I'll not side with one or the other here as this has been debated in several other questions.1
If your DM rules that mounts must act on their own turn before/after the PC's then the example you give is not possible because the mount would have to move and Disengage then the PC would use their turn to Attack. But since it would no longer be the mount's turn, the mount could no longer move the PC away and the mount and PC would remain in front of the enemy.
The one way it is possible is by having the PC, on their turn, use their action to Ready an attack when their mount brings them in range of an enemy. Then on the mount's turn, it moves, disengages, and moves back, and the player uses their reaction to make one attack while in range. However, the PC would only get 1 single attack so it is not really perfectly the same as what you envisioned.
If your DM rules that a mount's movement and actions can be interspersed with the PC's2 then this strategy is possible exactly as you say.
1 - See Does a controlled mount share its rider's turn? and Can a rider move using his mount, attack from his mount, then have the mount dash away? for further discussion. Note this is an example of designer rulingd seeming to confuse, not clarify the issue at hand.
2 - Even for those DM's that agree that the rules strictly say that this cannot happen, this is a very common houserule (including at my table).
In general, riders and mounts can be targeted like any other creature
The rules for Mounted Combat don't specify how targeting works for the Attack action (or any other action) because targeting riders and mounts is no different that targeting any other creature, with the exception of opportunity attacks.
Whether you can target either, neither, just the rider, or just the mount has nothing to do with their status as rider and mount, rather it depends on many other circumstantial factors, the most common of which are by far range and total cover.
From Making an Attack:
Choose a target. Pick a target within your attack's range: a creature, an object, or a location.
From Total Cover:
A target with total cover can't be targeted directly by an attack or a spell, although some spells can reach such a target by including it in an area of effect. A target has total cover if it is completely concealed by an obstacle.
For example:
- If your attack has a 5' range and you are a medium creature standing at the feet of a T-Rex, then you can target the T-Rex, but you probably1 can't target its rider.
- If you can see a rider peeking over a wall, but its mount has total cover, then you can target the rider with an attack, but not the mount.
Opportunity attacks
The rules for Opportunity Attacks state that:
You can make an opportunity attack when a hostile creature that you can see moves out of your reach. To make the opportunity attack, you use your reaction to make one melee attack against the provoking creature. The attack occurs right before the creature leaves your reach.
And that:
You also don't provoke an opportunity attack when you teleport or when someone or something moves you without using your movement, action, or reaction.
The rules for Controlling a Mount also state that:
if the mount provokes an opportunity attack while you’re on it, the attacker can target you or the mount.
In short, a rider never provokes your opportunity attack when it moves using its mount's movement. But if a mount provokes your opportunity attack, then you can choose to target the rider instead of the mount, despite the fact that the rider did not provoke said opportunity attack.
However, this does not mean you can target a rider regardless of all other factors such as range or total cover. For example, opportunity attacks occur retroactively just before the target leaves your reach, but if the rider was never within your reach to begin with, then you can't possibly attack the rider.
- The height of creatures and the location of a rider atop a mount are often not well defined so there is room for DM adjudication.
Best Answer
Given that you appear to have all the rules already, it seems that the problem is in interpretation. Given that, my view is :
Should the mounted PC be treated as a normal mount for a PC, losing his turn and becoming subordinate to the rider?
If 1 is "no", do they share initiative counts?
If 1 is "no", can the rider use his move action to make the mounted PC move, or force the mount to act by spending his own actions in any other way described by the Mounted Combat rules?
As above; if one wants to move an the other doesn't, then it's either a dismount or a fall-prone for the rider, depending on who's turn it is.
Per the comments; the mount should only be able to be move normally once per round - whichever commands the mount uses their move action to move, the other still has a move action but can't use it to move (unless it's the rider dismounting). Clearly other sources of movement (e.g. warlords) would still have the expected result - and the mounted combat rules cover that sort of thing already.
Can the mounted PC use the rider's base skill check bonuses as described in the Mounted Combat feat (e.g. a human with a pixie on his shoulder uses the pixie's Stealth modifier)?
How would feats like Holy Steed, which gives a rider's mount bonuses to defenses and damage, be applied?