Absolutely — Left 4 Dead 2 is built around four-player co-op, so two is well within range. Two players simply means two AI-controlled survivors fill the remaining slots.
You will both need your own copy of the game and a Steam connection, then one of you hosts and the other joins from the lobby. The director scales encounters to the number of human players, so a duo run is tuned rather than simply easier.