The follow-on rule is basically used to enforce a batting team's second innings immediately after their first innings in Test cricket if they fail to score a minimum threshold in comparison to the opponent's first innings total.
The follow-on is applied in matches spanning five days or more. If Team A bats first and posts a significant total, Team B must score within 200 runs of Team A's total to avoid the follow-on.