Please, read my comment.
First way:
If you use IIS, you can limit count of connections the way is described here:
Limits for a Web Site <limits>[
^]
Second way:
You can collect information about the count of connections.
The idea is: when user open your application/site, it checks how many users is already connected. If the count of connection is less than limit, application/site enables user to use it. If the count of connection exceeds the limit, application/site does not allow user to use it. When a user leaves application/site, it must 'remember' this fact to decrease the number of active connections.
So, you have to create a database and write methods to increase/decrease the count of active connections.