You have to:
1) drop the correct set (every domain drops two sets, I am convinced it is not 50%/50%, see my question on the site)
2) get the piece you need (5 pieces - Feather / Flower / Sands / Goblet / Circlet)
3) get the preferred main stat (good stats have a far lower % than bad ones, changes for each piece. For example Elemental Mastery Goblet has a 2.5% chance)
4) get good enough sub stat (preferably 4, again good stats like Crit % have a much lower rate than useless ones like Def)
5) hope the starting values are good enough (each sub stat has a range of values)