Welcome to the community! Hang in there, this too shall pass..
As Ekkie already described in-detail, your Pionus is right at the age where his sex-hormones have kicked-in to high-gear, and right now is breeding-season, so they are raging for everyone right now...It's extremely important that you make sure that your bird doesn't have access to anything inside or outside of his cage that creates a small, dark place that he can get into or underneath, as Ekkie already listed. So no "Huts", Beds, Tents, Hammocks, ANY TYPE OF "NEST" OR ANYTHING THAT COULD BE SEEN AS BEING A NEST OR NESTING-MATERIAL AT ALL, no Boxes of any kind, and no getting underneath furniture, behind pillows, underneath blankets or towels, etc. So if you have any of these items that they commonly sell in pet-shops for birds, like beds or the "Huts" which are the fabric "bags" that you hang-up inside their cage that they can get into, they all need to be thrown out immediately, no Nest-Boxes or any other kinds of boxes, and no types of "bedding" in the bottom of his cage, only sheets of newspaper or butcher-paper, or proper bird-cage liner papers that are UNDERNEATH the Grate in the bottom of the cage...Also, no warm, mushy foods like oatmeal, grits, mashed potatoes, or hand-feeding formula (unless he becomes sick, stops eating, and his Avian Vet suggests that he be Tube-Fed formula, that's different)...
As Ekkie also mentioned, no one should be touching him ANYWHERE but on his head, face, the back of his neck (stopping at the bottom of his neck!), and under his chin (although this seems to be causing issues too depending on the bird)...He shouldn't be touched on his back, wings, under his wings (this is a huge arousal-area for them), no where on his chest/belly/abdomen, on his legs, tail, or anywhere near or even around his Vent area...No cuddling him under your shirts either, that will typically do it as well...Hopefully if you remove/stop any of these things that he has in his cage or has access to outside of his cage, and you stop doing any of them, it will soon start to calm his hormones down and knock him out of breeding-season...But this is only a small part of the issues you're having...
I understand that your daughter hand-raised/hand-fed your Pionus, probably from the age of 2-3 weeks-old. Naturally when a certain person is solely-responsible for hand-raising/hand-feeding and then weaning a baby bird, the bird typically becomes very bonded to the bird, especially if that person is actually going to be the bird's owner and keep the bird with them (rather than what a breeder who hand-raises baby birds does)...However, when there are multiple people living in a household (all of whom make-up a pet-bird's "Flock"), it's not uncommon for them to change their affection from the person that they originally chose as "their person" to another person. Sometimes it happens as a result of them going through puberty, sometimes there is no particular reason that we can pick-out, it just happens. And then they may change it back, change it to someone else, etc. And a lot of the time the person the bird chooses as "their person" is the person in the household that wants nothing to do with the bird and does nothing at all for the bird...And there isn't a lot you can do about influencing them to choose a certain person or to switch-back to a certain person, they don't work like dogs, cats, or any other type of pet, they have the intelligence of a 3-4 year-old human child, and they use logic and reasoning skills as such, so it's not as simple as "Here, I'll give you a treat and you'll like me again"...Yes, making sure that a certain person is the one who always gives them ALL of their treats/good food and does all the good things, that can help sometimes, but in-general it kind of is what it is...
Now what you're describing as far as your Pionus suddenly biting you and your daughter out of nowhere or due to the dog barking or your husband walking into the room, etc...Believe it or not, parrots often bite the person they are most-bonded too because they are trying to protect them, as in "Get out of here, don't you see that dog barking at you?"...That's often how their brains work, and if they are afraid of a dog then you should be too...I'm not really clear on exactly who it is in your home that your Pionus is currently NOT biting and is bonded to closely, or whether he is always aggressive with you or your daughter, how he interacts with your husband, etc. But typically they do bond very closely with one person in the "Flock", and their relationships with the rest of the people in the Flock can go either way. If he's not currently bonded to anyone in your household and he's biting everyone equally, then it's definitely more hormone-driven, and you need to start using a Positive-Reinforcement technique to start encouraging the good behaviors you want him to display...Punishment or Negative-Reinforcement when a parrot does something they shouldn't, like biting, does not work at all and typically makes the behavior worse...So when he bites someone they can't yell at him or scold him, or "flick"/tap him on the beak (that's a big no-no), etc., because he'll probably just bite you harder...
Instead, what you all need to start doing is greatly-rewarding his good behaviors, such as when he steps-up for you without biting, or he comes to you when you call him, etc., with a "Training-Treat", which is his very favorite treat in the whole world, and that you all need to keep in your pockets or within reach at all times so that you can quickly reward anything that he does that is a desired-behavior. Make sure that he NEVER gets that favorite treat at any other time or it's not special and it's not worth him working for it...And when he does bite anyone in the house, you all need to immediately "Shun" him, meaning you all take away your attention/affection from him, for a period of 5 minutes, no more and no less, and by this I mean that as soon as he bites anyone, the person who he bites immediately AND SILENTLY puts him right down on the floor and then turns their back to him, literally, as does anyone else in the room, and then you all must completely ignore him, don't make eye contact with him, you pretend he doesn't exist at all for 5 minutes no matter what...This is called "The Shunning Method", and it takes away the attention/affection they crave, while putting them on the floor makes them the lowest thing in the room, which they HATE.
If you do a search in the forum search-bar for "The Shunning Method" you'll find a bunch of posts that explain it in a lot of detail, why it works, and why other things don't work at all...It's very important (and difficult sometimes, I know) that whenever he bites anyone that they don't make any sound and they elicit no response at all, because if they yell "Ouch!" or they start yelling at him and telling him "Why did you bite me? That hurt!" or anything of the like, this is giving him more and more attention and he'll keep on doing it more and more...You just have to stay silent, don't look him in the eye or make any motions or sounds at all except for putting him right down on the floor and turn your back right to him and totally pretend he doesn't exist, no matter what he is doing, for a full 5 minutes, but no longer...And after the 5 minutes is up you don't want to immediately start talking to him again or going to him and paying any attention to him, but rather just walk away and start doing whatever you want to be doing, and then allow him to come to you, and when he does you pretend like everything is normal and the bite never happened...And if he immediately comes to you and bites you again right away, then you must do it again, you just put him right back down on the floor and turn your back to him for another 5 minutes, etc. You might all be doing this over and over again for the first day, but I've not ever seen it take longer than the first day for any parrot, from Budgies to Cockatoos, to get the picture...
Controlling his sex-hormones is going to be step #1 that you need to remedy right now, if there is anything inside of his cage as described above, or he has access to anything outside of the cage it needs to be removed/blocked-off to him...He'll be fine without his bed, Hut, Tent, Box, etc., they don't need them if he has one and he'll get over it...Also, make sure that he is ALWAYS getting a full 12 hours of sleep every single night, because if he's not then that will cause hormonal-behavior as well...Realize that parrots in the wild are all on a "Natural-Light Schedule" every single day of their lives, regardless of the season/time of year. This means that they all wake-up as the Sun starts to rise, and they all go to sleep as the Sun starts to set (this is why we don't see or hear birds any longer as soon as the Sun has set, and also the reason that we first hear birds in the mornings just as the Sun starts coming up)...A Natural-Light Schedule does wonders for halting their sex-hormones, and it also ensures that they are ALWAYS getting at least 12 hours of sleep every single night, which also keeps their hormones calmed and their attitudes good. So if you put him on a Natural-Light Schedule and make sure he can see the light-changes at Sunrise and Sunset as he goes to sleep and as he wakes-up, and you make sure he's getting at least 12 hours of sleep every night, this will make a noticeable difference after a couple of weeks of doing it...It means that during some seasons he will be going to bed much earlier than usual and later than usual during other seasons, but that is exactly what they do naturally...