<human>: Condense the text into a few key points

So, my friend has a boy who is 3 years old. She's a single stay at home mom and devotes her life to him and her youngest. About two months ago, her 3 year old who is very smart, (know's his abcs can count and read some) has been acting out. He's been potty trained for a while, but recently has turned to running around peeing on everything and pooping in bed or on the floor. He knows it's wrong but still does it anyways.

She's started taking others advice doing things like spanking him, putting him in a cold shower, and making him wear his dirty clothes on his head because it's gotten so extreme. I'm personally not a fan of this, so I said I'd ask around, talk to some friends, do some research to see what could be causing this behavior. Especially since he knows he'll be punished for doing these things.

I told him that maybe she needs to start looking at some behavioral specialists (but she doesn't have much money). 

So, now I'm here Reddit, I'm just wondering if anyone has any kind of experience with this and has any advice. I have a one and a half year old, so I'm just learning all sorts of things about kids now, I used to think that I knew everything but as soon as my daughter was born I was shown how stupid I really was in the area. So, I didn't really know what to say to her other than I'd look for some help. We, and her friends and family all thought it would just be a phase. But with it going on for months I can't really imagine being in this situation so I wanted to help her out. Any info could help us, I haven't found much online except for kids acting out for attention, and I can tell you this kid gets all the attention he needs from sun up to sun down.
<bot>: Smart kid who is given all the attention in the world, started a few months ago pooing and peeing all over the house, he's not stopping even after some extreme punishments. Any advice?