At first sight, God's command to Saul looks clear and unambiguous.
Now go, attack the Amalekites and totally destroy all that belongs to them. Do not spare them; put to death men and women, children and infants, cattle and sheep, camels and donkeys.
1 Samuel 15:3, NIV
But if we are going to understand it correctly, we need to see how Saul would have understood it. We can see a lot of that from reading the passage closely, and from reading other similar and related passages.
Saul wouldn't have understood the command exhaustively to mean that he must kill all the Amalekites. We see this from 1 Kings 11, for example.
Hadad was from the royal family of Edom, and here is how the LORD made him Solomon's enemy: Some time earlier, when David conquered the nation of Edom, Joab his army commander went there to bury those who had died in battle. Joab and his soldiers stayed in Edom six months, and during that time they killed every man and boy who lived there. Hadad was a boy at the time, but he escaped to Midian with some of his father's officials...
1 Kings 11:14-17, CEV
The writer doesn't see a problem with both saying that the soldiers killed everyone there, and also that there were some survivors who escaped. It doesn't mean "hunt down and exterminate the Amalekites"; it means "kill everyone who stays and fights".
I don't think Saul would have understood the command vindictively either, when we understand how war worked back then. The purpose of war was generally to take plunder - slaves, valuables or flocks. The rules governing war in Deuteronomy 20 specifically allowed Israelites to take plunder when fighting outside their own land. But here the Israelites are specifically forbidden from taking any plunder - whether cattle or livestock or wives or slaves. That's why children are included - it's not telling the Israelites to be especially vicious - it's telling them not to profit from the battle.
That also makes most sense of why Saul is condemned later in the passage. Saul allows the Amalekite king to live, and also allows his soldiers to take some plunder. And Samuel says:
Why did you not obey the Lord? Why did you pounce on the plunder and do evil in the eyes of the Lord?
1 Samuel 15:19
Saul's sin in this passage is not showing mercy to the Amalekites; his sin is trying to profit from their destruction, because that is what God specifically forbids in v3.
I suppose a modern equivalent of v3 would be "Attack them. Take no prisoners. Take no plunder." That's what God commanded Saul to do to the Amalekites.