To share the Apple Music service in a family group, one needs to get (or change to) the Apple Music Family subscription.
You also need to set up (define) the Family Sharing group. One adult in the group should act as the organizer, that can invite people using all their Apple IDs. You don’t have to be a parent to be the organizer, but you need to be of age and have a valid payment method for family sharing (e.g. credit card). It is advised that the family group organizer is the one to get the Apple Music Family subscription.
Family Sharing - Apple Support
Set up Family Sharing - Apple Support
Get an Apple Music Family subscription - Apple Support