Does baseboard trim need to be nailed to the studs?
Yes, two nails in the stud. And some glue wouldn’t hurt. Now I know many trim carpenters that just try to hit the sill plate. But if there is a thick floor, like tile or hardwood, then they only have about 3/4″ to hit the plate. And many times they miss. Also if you are aiming for a stud, you reduce the chance of hitting a pipe or wire, because the pipe and wire is usually higher than baseboard through the studs and a couple inches from the stud through the sill plate. Sure they have nail plates, but I’ve seen nails twist over the plate and still hit a copper supply pipe. And it doesn’t start leaking heavy right away. Months later the nail rusts out and you have a mess.