Range of n for checking

Could not understand why the range of n while checking is (2,n-2). Why it is up to n-2.

Refer this
https://cp-algorithms.com/algebra/primality_tests.html

Thank you very much for sharing this awesome resource. I understood it very well.