First of all, let's distinguish between the linguistic phenomenon (Germanic) umlaut (or i-mutation) and the grapheme umlaut diacritic. In German, these two concepts are very closely related, because letters with umlaut diacritics (ä, ö, ü) are almost always used to spell vowels resulting from i-mutations and rarely used for other words. All modern Germanic languages have been affected by i-mutations and many languages (Germanic and non-Germanic) use vowels with umlaut diacritics, but only German has this close correspondence.
OP seems to have noticed a pattern of umlaut diacritics appearing in inflected words (presumably plural nouns for instance) and assumed there is a rule for this. The reason we see this pattern is that the i-mutation occurs in words with an /i/, /iː/, or /j/, and only certain inflections of a word had this sound when the i-mutation took place. From the Wikipedia article on Germanic umlaut:
Although umlaut was not a grammatical process, umlauted vowels often
serve to distinguish grammatical forms (and thus show similarities to
ablaut when viewed synchronically), as can be seen in the English word
man. In ancient Germanic, it and some other words had the plural
suffix -iz, with the same vowel as the singular. As it contained an i,
this suffix caused fronting of the vowel, and when the suffix later
disappeared, the mutated vowel remained as the only plural marker:
In this quote they use the English forms man/men, but it of course also applies to the German forms Mann/Männer.
The Wikipedia article also gives a few examples of loan words spelled with umlaut diacritic in German even though they have not been affected by i-mutaion (examples bolded by me):
Conversely, some foreign words have umlaut diacritics that do not mark
a vowel produced by the sound change of umlaut. Notable examples are
Känguru from English kangaroo, and Büro from French bureau. Here the
diacritic is a purely phonological marker, indicating that the English
and French sounds (or at least, the approximation of them used in
German) are identical to the native German umlauted sounds. Similarly,
Big Mac was originally spelt Big Mäc in German. In borrowings from
Latin and Greek, Latin ae, oe, or Greek ai, oi, are rendered in German
as ä and ö respectively (Ägypten, "Egypt", or Ökonomie, "economy").
However, Latin/Greek y is written y in German instead of ü