The first definition of “nut” on yourDictionary.com is:
“An indehiscent, hard-shelled, one-loculated, one-seeded fruit, such as an acorn or hazelnut.”
“Indehiscent” means not splitting open at maturity. “Loculated” means having, formed of, or divided into small cavities or compartments. So by this definition, a nut is a fruit that has one seed inside a hard shell that doesn’t split open at maturity and that has one compartment or cavity.
Peanuts have more than one seed inside the shell, so they aren’t nuts by this definition. I don’t know whether peanut shells are soft enough to disqualify them as nuts by this usage. I also don’t know whether peanuts split open at maturity, but I doubt it: peanut plants plant their own seeds by forcing their seed-borne stems into the ground. Any splitting would take place underground, which doesn’t seem likely.
This definition is a botanical one. The second definition in yourDictionary.com is:
“A seed borne within a fruit having a hard shell, as in the peanut, almond, or walnut.”
This is the common usage, and it’s perfectly OK to call a peanut a “nut” outside of botany class.