I am a canine behaviorist, btw. Not a dog whisperer by any means.
I teach methods based on science developed in last 10 yrs...
Rather than yell, punish, scream, rattle, shake or roll... we teach the dog what to do instead of always correcting the undesired behavior...like the person first suggested.
Teach the dog to drink only fresh water. Lesson to dog: Fresh=good; chlorine=bad.
Dogs have 220 million olfactory nerves compared to our 5 million receptors...so they can tell the difference.
If you teach a dog a
desired behavior (ie. stay out of pool) instead of trying to correct the undesired behavior, you do not damage the relationship with your dog. A dog who is yelled at is fearful and has not learned
what to do instead...
No, a dog that cowers when you get home because there is trash on the floor, did not learn to not counter-cruise or get in trash. In the dog's mind, the 'monkey' behavior you exhibit (we are primates, dogs are canines) tells them you are out-of-your mind angry for some
unexplained reason!
They do NOT know the reason why. To correct a behavior and associate it with punishment or correction, it has to be within 2 secs of when dog did it for the canine brain to associate action and punishment.
Otherwise, the dog sees you as something to fear and unpredictably aggressive. You may actually create an aggressive dog using fear-based punishment.
It is old school to shake a can. John Fisher who started that learned before he died, it is much more effective to teach a desired behavior and praise the heck out of the dog with verbal praise, smiles and CHICKEN!

I have trained many dogs that are terrors to begin with without screaming or scaring. It is about "thinking like a dog" and communicating clearly what you want.
For instance, my cue to 'leave it alone' is combined with "go lie down" and I showed the dog where in the shade it is to stay while we are swimming. At first I treated the dog there, petted it. If it got up I would tether it. Of course if your dog hasn't been trained to sit quietly while tied, then that can be trained.
So my answer to how to keep the dogs out of the pool is simply, train your dogs to listen to you with positive rewards (voice tone, petting and food when doing it right). Giving your dog positive feedback rather than negative feedback, helps the dog learn to do it right...not repeat doing it wrong.
Here's something we know from science- Thorndyke's Law...Yelling at your dog, looking at your dog, touching your dog while it is doing something you don't want, actually INCREASES the chance it will repeat the undesired behavior. Any attention to dog (Yelling, shaking a can) will increase the dog's likelihood of doing the behavior again and again and again.
So the idea, is give you dog attention when it is lying in the shade and out of the pool, swimming in it's own kiddie pool, etc.
That method, combined with lots of play interaction and attention to your dog when you are not in the pool will lead to lots of fun with dogs and pools.
BTW- the dog that loves the pool, does get to swim as a reward...when she has been quiet and waiting. This dog was no angel...she whined lots as a puppy (she is only 3 yrs old now)- has more energy than a kangaroo...but happily we have built a relationship where she gets what she wants when I get what I want.
Cheers!