“Separation anxiety” is a phrase that’s often used when a dog becomes anxious when left alone. Some dogs with separation anxiety will bark all day when left alone. Others are so nervous they have accidents, and some dogs will destroy property in an attempt to get out of the house.
On the other hand, just because your dog is acting this way does not necessarily mean he has true “separation anxiety.” It could just be that he’s bored or that he’s not fully potty trained like you thought. Or maybe he’s just barking because he hasn’t been taught any other options.