Dog training myth – dogs love the backyard.
I have a big backyard and my dog loves it. Most dogs will prefer quality time with their owner to the biggest backyard.
There is no problem at all with dogs being kept inside or an apartment if they get enough mental and physical stimulation. To keep a dog happy and sane a backyard is not necessary, just nice to have.
A dog needs training, hopefully in a positive environment, walks, runs, interactive toys, company human or other.
I also think most dogs are calmer if they have access to the house when the owners are not at home.
If your dog barks when you are not at home you might want to reconsider how much dog training you do, how much exercise your dog gets, and how much interactive toys you provide when you are not at home.
You should also consider a dog door and a warm and protected place to doze away. The couch might be ideal!