The signal for a goal kick occurs when the ball has passed over the goal line last touched by an attacker. The Assistant Referee needs to be in position to make the call. Once the ball passes over the goal line, the Assistant Referee raises his flag as seen below.
Note: If the ball passes over the goal line and then returns quickly, the Assistant Referee raises the flag straight up (this gets the referees attention) and once the referee blows the whistle, then the Assistant Referee signals for the goal kick.