Go to l4d2 properties and then launch options. Launch the game. Then press m or your designated team switch button to switch teams. Additionally, if you want to spawn as a specific zombie, type in z_spawn hunter/spitter/tank etc.