Thanks for your question, my name isXXXXX and hopefully I can be of some assistance.
I'm sorry to hear that your dog is not feeling well, but hopefully he'll be back to himself soon.
Unfortunately, panting and lethargy and not specific for any certain disease or condition. When dogs are overheated or are experiencing an elevation in body temperature (fever) they compensate through panting in order to compensate and lower their core temperature because they can't sweat like humans. Depending on the region of the country you live in, your dog may have overdone it outside to the point where he is experiencing heat exhaustion or heat stroke. This can lead to extreme lethargy and sometimes shock and death. That being said, your dog may be experiencing lethargy and panting from a large variety of other problems or conditions, as these symptoms are not specific for any certain illness.
I would recommend monitoring his vital signs and overall mentation for improvement and then seek veterinary care if you feel he is not looking better soon. You can measure his body temperature rectally with a thermometer, and normal ranges from 99.5-102.5. If there is no underlying reason for the panting to continue other than he may be overheated, his respiratory rate should improve, and normal respiratory rate is about 12-36 breaths per minute. Also, you can take his heart rate by placing a cupped hand over his chest underneath one of his armpits. The number of normal beats per minute should be between 70-120. If you notice that his vital signs do not improve and his overall mental alertness seem to be continually declining despite getting him into a comfortable environment indoors, I would recommend seeking emergency veterinary care.
I hope this answer was helpful, I wish you and your dog the best.
Positive feedback is much appreciated.