In many apartment homes pets are allowed but it remains to be seen how well received the pet is among the other apartment owners. If the pet is foul tempered and barks at everyone, people are bound to complain and you might find yourself outside the apartment complex soon, hunting for a new place.
Keep your pet active
If you are unable to provide your pet adequate exercise, the pet might not be well behaved with others. A pet who is exercised and active will remain more social. For that reason, setting a routine of taking the pet to parks for exercise or for a walk is important.
Help the pet to socialize
It is important that the pet is comfortable around people. If you have friends who come over regularly, let them know the pet and allow the pet to be friendly with them. One could also get a sibling pet so that the two can play with each other.
Train it well
It is necessary that the dog is well trained and that has to come from the owner. It is necessary to teach the dog how to refrain from barking loudly by rewarding it when it stops barking. Excess energy needs to be channelized towards toys and chew bones so that the dog is calm when it meets strangers.
These are some ways one can ensure that a dog remains well behaved when living in an apartment home with strangers in close proximity.