The way to define group-2 verbs is the dictionary form ends in る. That’s always true, with no exceptions. You can’t say anything about the stem ending of group-2 verbs, because many also end with ~いる.
The trick comes in that the reverse is not always true – not every verb that ends in る is group-2. Some of them are group-1. Fortunately, there’s not an excessive number of exceptions. Basically the trick is to learn them. Sounding them out often helps too – often if you try to make a ます-form out of a group-1 verb using the group-2 rule, the resulting word will sound kinda silly. For example, はじまる –> はじまます sounds silly, so you can probably conclude it’s group-1. Which it is.
Here is one list of exceptions I found with only a bit of googling.
There’s also the rule “all group-1 verbs have ます-stems ending in い” which has no exceptions, but again, the reverse is not always true – as mentioned above, not all verbs with ます-stem ending in い are group-1.