What tool to adjust brakes
Shimano BR-MT520 brakes are hydraulic discs. The alignment can be adjusted by loosening the two mounting bolts. The bolts typically have Torx T25 size heads, so you need a basic T25 wrench at least. If your rear caliper is mounted between the seat and chain stays the bolts can be difficult to get to, so a L-shaped rather than a T-shaped wrench is necessary.  

The basic short-cut technique for aligning the calipers to loosen the bolts so the caliper can move but is not loose, pull the brake lever hard, tighten the bolts. See this Park Tool page for more details on caliper alignment.

If your pads are rubbing periodically as the wheel spins, your rotors are probably warped. They can be straightened fairly easily. There are special tools for this but an adjustable wrench works reasonably well. See this Park Tool video.

Update:

I read through the BR-MT520 Dealer Manual and it seems the mounting bolts are in fact 5mm hex heads.