The foundational rule, established already in the Gemara (Berakhot 37a), is that rice in its raw or whole-grain form receives the brachah of "Who creates fruit of the ground," while rice that has been ground, baked, or cooked until it softens receives "Who creates the various kinds of nourishment" both before and "one blessing abridged from the three blessings" afterward.
The Shulchan Arukh (Orach Chayim 208:7) codifies this distinction precisely: one who eats whole rice says borei pri ha'adamah followed by borei nefashot, but if the rice was cooked until it became soft (נתמעך) or ground into flour and baked into bread, the brachah is borei minei mezonot followed by borei nefashot — provided the rice stands alone without being the minority in a mixed dish.
The Mishnah Berurah (208:25–27) notes a secondary uncertainty about which grain is actually called "rice" in the earlier sources, but concludes that the common practice follows the ruling that cooked rice (ריי"ז) receives borei minei mezonot, and adds that if rice grains are still whole they receive borei pri ha'adamah, though once even partially softened by cooking the brachah shifts to mezonot.
Unlike rice, other legumes or millet that are made into bread do not rise to mezonot but fall to shehakol, since people do not normally bake bread from them — a contrast the Arukh HaShulchan (Orach Chayim 208:24–26) draws explicitly to highlight rice's special status, which preserves its dignity even in baked or cooked form.