The simple answer is both. The complicated answer is “wherever you are.” Since dogs are strongly pack-oriented animals, they want to be with their pack (in this case, you) whenever possible. So, if you’re inside, they’ll want to be inside. If you’re outside, they’ll want to be outside.
If you’re at work, they’ll want to hang out around the office. You get the idea.
Of course, some dogs behave well when kept inside, but bark, dig, and whine when out in the garden. This is because home is the “den,” and dogs prefer to be closer to the center of the den (the place where the pack’s smells are most acute). While some dogs are happy to stay outdoors during the day (while the rest of the pack is away), some dogs develop behavioural problems as a result of this daily “expulsion” from the den.
Additionally, dogs with access to a large territory sometimes feel compelled to “defend” all of it, resulting in frantic barking at “intruders” as well as other behavioural problems. Consequently, restricting the amount of territory your dog has to “protect” may reduce this type of behaviour.
Because of all this, a good compromise for many dogs is dual access, both to a restricted part of the house and a restricted part of the garden. The sort of access keeps puppy from feeling ejected from the “den” without having too much territory to defend. Also, a dog that can’t be trusted inside and is destructive outside will probably benefit the most from being crated during the day. With most dogs, if you crate them through puppy hood (which also helps with housebreaking), by the time they are mostly adult (from 8 to 24 months) you can start weaning them off the crate. Because they’re used to spending the time in the crate quietly, they will form the habit of spending that same time quietly as adults, whether in the crate or not.