7 mo puppy not understanding how to signal Hi everyone.

I have been struggling to get my puppy to learn how to signal to go outside. He’s 7 months now and I feel like I’ve tried everything and he’s just not getting it. I used the bells, got him to ring the bells every time we went out for months, yet he would still pee inside rather than ring the bells to go out when left to his own devices for a bit.

I give him treats and praise when we go out. I calmly tell him no when he goes inside to stop the stream then immediately get him outside and give him a treat when he goes. My partner did used to spank the puppy when he went inside, but has stopped. Could that be the issue? Any help is truly appreciated.