We are not veterinarians and our words will be confirmed by a qualified person, but what seems rather safe is that you need a low-energy diet with a big piece of high protein to help you take the muscular mass.
Then, if your horse remains thin it may be due to stress (maybe trying supplements based on plants to reduce stress and anxiety) but also watch out if he doesn't have ulcers. Ulcers are not very generally good for weight gain. The ulcers are very good, rest assured.
Finally, the work of bodybuilding is also very important. The more the horse works in the right direction (thanks to possible rehearsals and adapted exercises), the more he gets muscular, and the more he will gain weight.
All The Best,