There are words that just should be remembered, for example annual, annoy, banner etc - no rules.
You can only have rules for adding endings, suffixes or prefixes.
The final n in a short stressed syllable is doubled so as not to get the syllable open:
to sin - sinning, sinned, sinner
to begin - beginning, beginner
to run - running, runner
If you add the prefix un-
Student or Learner