Assuming you do not have any extra attacks involved, can you start your turn holding a 2-handed weapon with one hand, use your free object interaction to draw a javelin, then throw the javelin with your attack and return your hand to your 2-handed weapon for opportunity attacks (such as granted by Polearm Master)?
The difference between this and other questions is the javelin will no longer be in your hand at the end of your turn so the meat of it is can you put your now empty hand back on the two handed weapon so you can use said weapon for opportunity attacks before your turn ends or not.
Scenario 1. As described holding 2h weapon in one hand. Draw javelin, throw javelin, place second hand on 2h weapon. Is that legal to do in one turn?
Scenario 2. If no to scenario one, would the answer change if you started your turn holding 2h weapon in one hand and javelin in the other? I’m almost positive this setup would work because your free object interaction would be grab 2h weapon with both hands.
Best Answer
Yes, you can draw and throw a weapon while still using a two-handed weapon for opportunity attacks
According to the PHB Errata, you only need two hands to attack with a polearm, not to wield it.
Per Jeremy Crawford (no longer official rulings, but still a strong indication of RAI), it is a non-action to switch between one and two hands:
This interpretation is supported in-game by two-handed weapons which use ammunition, for example the longbow; As part of the (potentially multiple) attacks, you must take a hand off the weapon to draw ammunition, then grasp it again, without using your free object interaction.
As always, it is best to check with your GM. As this is somewhat of a grey area in RAW, some tables may be more restrictive and rule that swapping to a two-handed hold requires your free object interaction.