A. When your partner in doubles is serving.
In general stand with your feet together and reach as far as you can with your racket (with your hand on the grip), so that you are barely touching the net with your racket. Next, take the largest step backwards than you can. From this position, you can cover more lobs that would normally go over your head and still accelerate forward to make a volley. Remember that it is always easier to move forward rather than backward. Your position, in relationship to the alley, is determined by your expertise. Stand where, when you take your inside foot toward the alley, you just cover half the alley. Poaching is fun and your opponent hitting down your alley is low percentage.
B. When you are in the point and your opponents are in the up and back position.
When the ball is coming from the short player (the player closest to the net) you can afford to crowd the net. When the ball is coming from the deep player (the player pinned on the baseline) you should stand back from the net a little farther, anticipating the lob. In theory, you want the net player to hit up to you so that you can hit an offensive volley. The deep or baseline player has more court to throw up a lob to protect his partner.
Why do you see the pros stand so close to the net? Answer: Because their overheads are deadly and their footwork moving backwards is impeccable. Not true of most club players. Most club players would be better off just controlling the overhead than moving forward to win with the next shot.
C. When all 4 players are at the net or are coming to the net.
This, I believe, is the most fun part of tennis to play and to watch. In this position, you are better off moving forward in a constant, yet controlled movement. This position only lasts a few seconds. Do not be caught standing still. Your reflexes will work better when you are moving forward. Plus, your forward movement helps minimize how much angle your opponent can hit. In this scenario, you can rule out the lob - move forward!
In general, the better your overhead is, the closer you can stand to the net. However, if you are like most club level players, you will stand very close to the net so the volleys are easier. In this scenario, the burden falls on your partner to cover his/her half of the court and to cover all the lobs over your head. This is a great burden to give your partner. Stand back a little farther and start covering a high percentage of lobs that would normally go over you head. As you compete more, your position from the net will be constantly changing during the point. If you feel like you are in the same position during the point, you are probably losing or becoming targets.
The old image of you partner telling you to stand in the alley and on top of the net is out. Stand where you can get in the point, have more fun and get more exercise.
Good luck on the court.