Yes, you can play with two players online in Left 4 Dead 2. Any remaining spots in the group will simply be filled in by AI-controlled characters, so your team is always complete.