Unless you're incredibly lucky, it is not going to be immediately obvious what ingredients your dog has an allergy or sensitivity to in food. The only reliable way to find out is to undertake an elimination trial. That works as follows:
1. Change your dog's food to something he has never eaten before. That means something made from ingredients that he has never previously been fed. So, if you've been feeding a food made with (say) chicken, rice, barley and potatoes, the food you swap to must NOT contain ANY of those things. Same goes for any food you may have fed previously - check what the ingredients were, and then look for something that has none of those things in it. You need a completely "unique" food - unique meaning ingredients that the dog has never previously been exposed to. For this, you may need to look at a limited-ingredient food aimed at allergy sufferers.
The reason for choosing a unique food like this is that it is impossible for the dog to have a pre-existing allergy to something he has not previously been exposed to. Therefore, IF his symptoms persist on the unique food, you have actually proven that the problem was not a food allergy at all

Bear in mind that you need to give it time to work - about 12 weeks, during which time you feed nothing else, treats included.
If, on the other hand, his symptoms clear up - then you have proven that the dog had an allergy to one or some of the ingredients in his old food.
That is something - but actually not enough. Not if you want to know exactly what the problem is (which is worth knowing - as otherwise you end avoiding everything that was in the old food, just in case it is the problematic ingredient). So, you should then embark on the elimination to find out what exactly the problem ingredient(s) are.
The way to do that is to add BACK into his diet, one by one, ingredients that he had previously. You try each thing separately, for about a week, and note whether or not he has a reaction (no need to continue after he reacts though - just mark that ingredient as a problem, then dump it from his diet, take a few days break to let him re-calibrate, then try the next ingredient). Once you get through that process, you would know precisely what is and isn't a problem.
Don't forget that this also applies to treats. And in those cases, it's not always the main ingredients that are the problem, but might be the chemicals and preservatives. But these are also things the dog consumes, so need also to be eliminated from the diet initially, and then tested in the elimination trial one by one to see if they're part of the problem.