Hello, my name is***** and I have over 20 years of experience as a veterinarian. I am sorry to hear that your kitty is breathing hard (panting) with his tongue out and drooling.
This does not sound like a hairball. With a hairball they may cough, gag and vomit, but then the nausea passes.
This could signify severe nausea or anxiety/stress or if the color of his tongue and gums is blue/gray or very pale that can signify difficulty breathing/exchanging oxygen.
Either way cats don't efficiently exchange oxygen by panting, so they don't do it unless things are very bad for them or they are extremely stressed.
If this was preceded by a very stressful event for him, he has only been doing this for a short time and his color is fine, then give him time to settle down and see what happens.
But if this has been going on for a while, he has vomited several times, and/or his color is poor (blue, gray or white), he has facial swelling or hives, then it is time to seek emergency care.
Please let me know if you have any further questions.