To allow login only some users you can use AllowUsers keyword in /etc/ssh/sshd_config.
To restrict a number of ssh connections You can use MaxSessions keyword.
AllowUsers jack joe
This keyword can be followed by a list of user name patterns,
separated by spaces. If specified,
is allowed only for user names that match one of the patterns.
Only user names are valid; a numerical
user ID is not recognized. By default, login is allowed for all
users. If the pattern takes the form
USER@HOST then USER and HOST are separately checked, restricting
logins to particular users from
ular hosts. The allow/deny directives are processed in the
following order: DenyUsers,
DenyGroups, and finally AllowGroups.