There is two ways to formulate a reward function for these types of problems. First there is sparse reward:
All other rewards are 0.
As the opposite there also exist dense rewards, which could be some signal for every timestep which tells you how well you're doing, i.e. give rewards in chess if you kick an opponents piece of the board.