Yes, two players can team up online in Call of Duty: Modern Warfare (2019) on Xbox Live. Here's what you need:
Caveat: Some modes have minimum player counts (e.g., Ground War needs more). You may not always find a match with just two, but standard 6v6 modes work fine.