You won't need an iRule if you are only interested in limiting the maximum number of concurrent connections allowed for a given virtual server. It is something you can set ("Connection Limit") from the advanced settings of the virtual server definition.
If you would like the limit to be on a per client basis, an iRule using the table command should do.
The first example of the below link may just be what you need.
table - DevCentral Wiki : http://devcentral.f5.com/wiki/iRules.table.ashx