Complex sentence: The king (or an old peasant woman, in Lang's version) wants his three sons to marry, so he creates a test to help them find brides.
Split into simpler sentences: The king (or an old peasant woman, in Lang's version) wants his three sons to marry. To accomplish this, he creates a test to help them find brides.