"He showed premeditation," Prosecutor Bill Douglas said Tuesday.
Duncan, 42, has been held without bail in the Kootenai County Jail. He was already charged with kidnapping in the abduction of the two children.
The charges are for the deaths of Brenda Groene, Slade Groene and Mark McKenzie, Douglas told television reporters.
The three were beaten to death in their rural home near here sometime late on May 15 or early May 16. Shasta Groene, 8, and Dylan Groene, 9, were abducted at the same time.
Brenda Groene, 40, was the children's mother, Slade was her 13-year-old son and McKenzie, 37, was her boyfriend.
Newly released court documents from a closed-door hearing on Tuesday provide details into how and why authorities believe Duncan committed the crimes.
According to the documents, Duncan had spotted Shasta playing in a bathing suit with her brother, Dylan.
"(Duncan) told her he watched her two or three days, and at night would peer inside the home," Detective Brad Maskell told the judge, according to the records. The records also say Duncan used night-vision goggles to learn the home's layout before bursting in.
Shasta's ordeal began when she heard her mother call her into the living room early on the morning of May 16, according to authorities. There, she told investigators, she saw Duncan wearing dark gloves and holding a shotgun.
Her mother, brother Slade and McKenzie were bound with zip-ties and duct tape.
Duncan then bound her and Dylan and left them on the ground outside near a swing set. Shasta said she heard McKenzie yell out several times, and at one point they saw Slade stagger, bloody and incoherent, out of the home.
Maskell said Duncan bragged to the girl about killing her family with a hammer and showed it to her.
Officials have alleged that the children were repeatedly sexually molested during their ordeal and that the motive for the killings was to acquire the children for sex.
Duncan, raised in Tacoma, Wash., but most recently a resident of Fargo, N.D., has already been charged with two counts of first-degree kidnapping. That crime can bring the death penalty in Idaho.
Shasta was rescued July 2 after being spotted in a Coeur d'Alene restaurant in the company of Duncan, who was arrested at the scene.