It may be barking at something it sees outside or because it's trying to get your attention. Try to slowly expose your dog to outer stimuli more and give it treats and praise when it doesn't bark to help train it.