Avoid mass-produced brands and go in the direction of a smaller, more natural organic brand like Blue Buffalo, Merrick, and Wellness (to name a few). A lot of the bigger companies cut corners, leaving the food with a lack of nutrients. So when dog food is cheap, it's probably lacking vital nutrients too.
When purchasing a dog food look at the ingredient label. The food is made up mostly of the first ingredient on the label so if it says chicken or beef then you should be good to go. Avoid any dog food where the ingredient label starts with something like chicken meal or oats. If you can afford it, get the dog started on a dehydrated food (Stella and Chewy's or Honest Kitchen) or a raw food diet (Abady). These foods have tremendous nutritional value and will make your dog healthier and happier. Typically, dogs are fed twice a day, once in the morning and once in the evening. Add a little water to their kibble to help release the gas in the food which will cut down on the dog's flatulence.