We list the number of decisions that the robot is making while following the line. Then, we group them and decide on the number of sensors to be used.
Three sensors is a good solution. I would say it is possible to follow the line with two sensors, but I am also making the assumption this would make the robot program quite complex. It is a good practice to always keep your programs as simple as possible. We might do one course of following the same line with two sensors, but for this course, we would stick with three.
Four sensors are the maximum number of Mindstorms sensors that could be attached to the Mindstorms brick (at least, officially). It might make the program more precise, but for this line three is just good enough.