I don't have an Xbox, but here's what you need for Call of Duty: Modern Warfare 2 (2009) online on Xbox 360:
Critical Note: Xbox Live for Xbox 360 shut down in 2020. You cannot play the original MW2 online anymore. The 2019 Modern Warfare reboot works on Xbox One/Series X|S with Xbox Game Pass Core.