He's probably anxious. Start slow, just sit in the car without going anywhere with him. Give him treats when he lays down or is just calm. excessive panting is a sign of stress so until he is relaxed don't move onto the next step. Once he is relaxed just repeat sitting in the car while the car is on. Then move yourself to the front seat and give treats for calm behavior from up front. When you are done with the sessions take him out and do something fun like playing in the yard or going for a walk. Once he comfortable with sitting in the running car drive down the driveway, stop the car and give some treats, then go back up the driveway, stop and give some treats. et out of the car and do something fun. Once he ok with this then you can move to short drives down the street making sure to stop and give him treats if he is calm. If he does not remain calm then go back to the previous step for a while. Then you can start going on longer and longer drives but always go somewhere fun, a park or trail that you can walk in or play at. Soon you'll make the car ride a predictor of something good (the park) and he'll be happy and excited to go on a trip.
Now if you think your dog is barking because of stuff he sees out the window I would block the windows with dark paper so he can't see out. If he's quiet for a short drive then have a passenger take a piece of paper down while you drive and as soon as he starts barking put the paper back up. Soon he'll learn if he wants to watch the stuff outside he has to be quiet.
If you go to let him out of the car and he starts barking just wait and once he stops let him out. If he then stats barking when you open the door then close it and wait. If once he's out of the car he starts to bark just wait patiently until he stops. Since you are going somewhere good he'll want to go play so he'll learn to stay quiet if he wants to play or go on his walk.
I also suggest either crating him or getting him a dog seat belt for safety purposes, a crate may also make him feel more safe and secure so long as you take the time to get him used to the crate in the house before using it in the car.