Hello, my name is***** and I have over 20 years of experience as a veterinarian. I am sorry to hear that your pup has intermittent loose stools, and yelps and bites the end of his tail.
Because he has loose stools and yelps before he bites his tail I am convinced that this is a pain response, and it is likely related to intestinal cramping.
If allowed to continue this may become a habit or turn into an obsessive/compulsive type behavior, so we do want to try to get a handle on this as quickly as possible.
I understand that he has had some testing done but it is worth doing a complete fecal panel to look for unusual parasites and bacteria to make sure that these aren't complicating things.
In a young dog, other than parasites and viral/bacterial infections, the most common causes of loose stools include pancreatic insufficiency or food allergies/sensitivities so I think your veterinarian is correct that a diet switch is in order, and a prescription hypoallergenic food makes sense.
If your pup tends to have voluminous stools that are greasy and he is having trouble gaining weight then testing for pancreatic insufficiency with a blood test called a TLI would be appropriate.
If your pup has created sores by his chewing those should be addressed with antibiotic therapy. In some cases we need to use anti-anxiety medication to break a habitual chewing cycle. In some dogs with obsessive behavior laser treatment of the lesions can be very helpful.
Please let me know if you have any further questions.