First of all, good for you for adopting a dog that has been badly abused! Most people wouldn’t do that! At least there are some people out there that have the time and patience to help a dog like that!
How come you keep putting him outside by himself? How long do you keep him there? Do you leave him outside all of the time? If the answers yes, then bring him inside and KEEP him inside the house. Dogs shouldn’t be left outside for any length of time. They get lonely! It’s not fun to be outside all by yourself! They need to be inside with their people!
You need to stay with him while he is outside. Then bring him inside when you go inside. All dogs should never be just left outside by themselves, abused or not abused. If you leave him outside, he is going to cry because he is lonely! He is trying to tell you “Hey! Where did you go”? “I’m lonely!”
When you adopt a dog that is badly abused, usually you don’t know the extent of the damage. For example as in how he was abused and where. Maybe he was abused while he was outside and now he is scared someone is going to the same thing. Even if he wasn’t abused outside, he is still scared and he has the right to be! Poor Sam has probably been through a really horrible, traumatic, experience before you got him!! It is going to take some time for him to realize that he is ok now.
Please DO NOT use Shock/Electronic/Spray collars on him! Who knows what happened to him while he was abused! He was probably beaten, hit etc. Using a Shock/Electronic/Spray collar on him is going to bring back bad memories for him. He doesn’t understand why he’s getting shocked when he barks anyway! Getting shocked hurts and it brings pain and I’m sure that he doesn’t need to be reminded of the pain he went though before he was rescued.
What you need to do is train him not to bark or cry with positive reinforcement. Shock/Electronic/Spray collars definitely DON’T come under positive reinforcement. Besides, Shock collars don’t fix the problem, they just mask it. Positive reinforcement is the best way to train ANY dog without force. All you need is some small treats, (not chewy treats because it will take him longer to eat them.)
If he starts to bark constantly tell him to be "Quiet". Say “Sam Quiet” when he starts to bark and praise him when he stops or give him a treat. He will soon learn that quiet means "Stop barking please". It will take some time for him to understand what quiet means. All dogs learn at different rates so be patient. It will be worth it in the end! You will be able to teach him to stop barking without force or hurting him.
It might take Sam longer to grow out of the whining. Dogs whine for a lot of reasons. He is probably insecure right now. Once you show him that he is living in a nice home now, (it will take some time) he will stop whining. If he only whines outside, then bring him inside.
I hope I helped!