When the Japanese invaded Joseon in 1592, King Seonjo escaped from Hanyang (present-day Seoul) and fled to Uiju. When the war finished, he returned to Seoul. But there was no place for him to stay, because all of the palaces(such as Gyeongbok Palace, Changdeok Palace, Changgyeong Palace) had burned down during the war.
So, he lived in this place, which was originally the home of Prince Wolsandaegun who was King Seongjong's elder brother.
King Gwanghaegun who succeeded King Seonjo renamed this palace Gyeongun Palace (Gyeongungung ; 경운궁). The palace became a secondary royal residence after the king moved to Changdeok Palace. Queen Dowager Inmok was confined to the palace, and it was renamed West Palace(Seogung ; 서궁). After he was overthrown by King Injo, it was returned to itsoriginal owners.
After two years, King Gojong returned to power and he chose to live in this palace. He renamed this palace Gyeongun Palace again. An electrical system and fencing were installed at the palace, and the name of the palace was changed to Deoksugung Palace: meaning the palace of virtuous longevity. He remained at the palace even after he had relinquished the throne to his son, Emperor Yunghui (or Emperor Sunjong ; 융희제, 순종)
From 1910 until 1945, when Korea was under the colonial rule of Japan, the palaces's buildings were destroyed and made into a public park.
Deoksugung for Kids. Kiddle Encyclopedia.