I came across this in my campaign, where a player used Investiture of Wind because there was a mini horde of skeletons on higher ground about to shoot another volley of arrows. One of the other players (Medium-sized), used their movement to stand behind the first player (also Medium-sized).
The spells says: "Ranged weapon attacks made against you have disadvantage on the attack roll." (XGE, p.160)
The player suggested that any arrows targeting him would also have disadvantage. I disagreed with this, but it did make me think whether standing directly behind the other PC would provide cover.
I gave him 1/2 cover in the end (so a +2 to AC), but I'm not sure now. (PHB, p.196)