Every service, in singles and doubles, must be played across the front service line, nearly 2 metres away from the net, and always into the diagonally opposite service court. Each side has one service (in singles and in doubles). If the serving side's score is even, the service must be played from the right service court, if it is odd, from the left service court. The first service (at 0-0) is always played from the right service court.
If the serving side scores a point, it keeps the service and starts the next rally with a new service from the left or right service court, depending on whether its score is odd or even. If the returning side scores a point, it also wins the right to serve. This principle applied to singles as well as to doubles matches.
In singles, the position of the serving player is easy to ascertain as it always and only depends on whether the serving player's score is odd (left service court) or even (right service court).
In doubles, a little more care needs to be taken as the two players of a side take it in turns to serve. Again, the service court from which the service is played depends on whether the score is odd (left) or even (right). If the side of the serving player scores a point, the player keeps the right to serve and moves to the other service court for the next service. This procedure continues until the returning side wins a point. In this case, they also win the right to serve, but they do not change service courts at that point. Service courts are only changed by the serving side.