The Goblin Hut spawns Spear Goblins after every 4.9 second.
You should place your Goblin Hut on either side of your land since the spawned Spear Goblins will always target the closest Towers/Troops. It should be also placed at the back of your land so the enemy troops can’t destroy them with ease.
You can use it to counter other spawning buildings such as the Tombstone and Barbarian Hut. They can easily destroy the opponent melee troops in range.
Don’t place the Hut near your Tower If you know that your opponent has the Lightning Spell or the Rocket. Otherwise, the opponent can deal damage to both your Hut and your Tower.