First of all, in /etc/pam.d/login
Session Required /LIB/Security/Pam_Limits.so
Then add the user name to be restricted in /etc/security/limits.conf
For example: Edward Hard Maxlogins 2
This means that users Edward can only log in.
Pam_limits.so still has many other features, you go Google.