You'd have to use a firewall, either one existing in your distribution or install one and then determine the settings in that firewall software which limits the number of connections per protocol port number.
I do not believe that the native networking allows for this level of protection or controllability, that's more specialized to the features provided by firewall software.
For Ubuntu there is something called the
Uncomplicated Firewall and you can add filters per protocol port number with the keyword "limit" to set up a filter to limit that port. Sorry I'm not sure of the exact syntax or whether or not this particular concept is one which is permissible with that software, I haven't used it. But looking at the man page for it, this appears to be a choice one can do, and also it appears that a "dry run" is available so you can see the changes before you actually apply them.
Actually, reading more "limit" there is not for connection limits, but rather rate limits. Therefore the UFW would not be helpful here, or at least that particular setting is not going to do what you want.