its all trigger based. the unit isn't actually ordered to attack and he typically doesn't even change animations because he will be walking and if u change to attacking he will look as if hes floating unless u create a combined animation yourself.
that said. You would do something along the lines of
event - player clicks
codition player left clicks down?
action - create unit (something that will be a bullet) for player and move it.
then you have to create another trigger for collision detection that will cause the bullet to do damage when it touches an enemy. not sure how that works in sc2 editor. search this site for top down fighter and look at the code inside this