Your dog taking things from counters is not only annoying and messy, it can also be dangerous. The wrong thing stolen from a counter top can make him sick and cost hundreds in veterinary bills. Prevention is important but not always possible, so the habit needs to be broken.
Place a large handful of pennies into several clean drink cans. Small rocks will also work. Close the openings of the cans with tape. Tie a string around the cans.
Tie the other end of the string around a food that is safe for him and will tempt him. Choose something you know he likes that has a strong odor to attract him.
Place the food on the counter, close to the edge so he has easy access. Hide the tied penny cans behind the food out of easy view.
Walk away from the food, but stay close enough to hear the cans rattling. If he only steals from counters when you are not home, walk outside but stay within hearing range.
Listen for the sound of the cans rattling, and enter the room immediately to take the food away from the dog. The sounds of the falling cans will have scared him and made him associate taking the food with the fear of the noise. Repeat this several times over the next few weeks, always changing the times and the food used.