The rooting of Xperia phones can be very tricky. I speak from experience since I have an M2 and the process of rooting had a chance of failure very high causing my phone to bootloop forever. Because of that, you should be extremely careful when you're doing it. However, you can find rooting instructions on the XDA Forums. You can use the link below to access the forums. Rooting guides are found in General & Help sections.
XDA Developers: http://forum.xda-developers.com/m4-aqua