This sounds like a very similar situation to my own dog. I have a thread about it you can read through here:
At wit's end with chronic diarrhea
My dog was not losing hair, although his coat was very dull, and he often refused food. We eventually did the biopsies and he was diagnosed with an autoimmune disease similar to Crohn's.
We went through lots of meds and food types over a period of about six months. He got to the point where he refused any and every type of kibble. He never refused raw but his stools did not improve with raw, nor did his discomfort after eating. I eventually cooked for him, chicken and white potato. We tried metronidazole (flagyl), doxycycline, doxy/flagyl together, prednisone, then prednisolone, etc. I eventually switched him to Tylan after several people here on the forums recommended it, although it did not alleviate the problem. We also tried a holistic approach for a time.
After six months of this we consulted with a GI specialist, had the biopsies done, and the specialist recommended chlorambucil (leukeran). It is an immunosuppressant. Between chlorambucil and Tylan, and continuing to cook chicken and potato, he finally improved. Over a span of about eight weeks, he put on 11 pounds, and is now at a healthy weight, and no longer has diarrhea. After he gained weight I slowly switched him from home cooked to canned chicken and rice, and he has done fine on it. He still cannot digest kibble properly.
He no longer refuses meals, ever, is the perfect weight, and has even more energy than before.
I would recommend trying Tylan, as it has worked for MANY dogs on this forum to help clear up diarrhea problems, especially colitis (large bowel diarrhea). For small bowel diarrhea it sometimes is not as effective. If that doesn't work, consider seeing a GI specialist. It would be an expensive visit, but they will be able to get at the heart of the problem more easily than a general practitioner. Our general vet told us she never would have considered chlorambucil for him, and that is the thing that has made all the difference for him.
Good luck. Keep us posted.