Keeping your dog outside in most places is not illegal unless the weather gets really cold or too hot and then the dog is suffering.
In some places it's illegal to keep your dog outside at all times and chained up and especially if the weather is too hot or too cold.
Some places have people that go around looking for dogs left outside in the heat and in the cold and will report it back to the other authorities who can then take you to court and remove the dog from your custody.
Sometimes the animal control may even come and get your dog from you without you being there and take them to the pound if they are found left outside in the cold or hot weather.
Always make sure the dog has food and water if you do leave the dog outside and check with your local laws and if it is too hot or too cold you really should bring the dog inside with you.