Then to attack just move up to the person. If you want to guard an area, target an approaching enemy and stand still. You will attack as the enemy approaches.
If you have targeted someone that is too far away and a closer enemy attacks you, <s> you should attack back</s> you will not attack back - you will however parry and dodge. Shield bashes and stance changes <s>will be made against the closer creature</s> will not work: shield bashing will say that you are too far (if that is the case) and using aiming will say that you show off fancy moves.
If you have your bow equipped and have targeted one enemy and have right-clicked to shoot another, you will shoot at the enemy you right-clicked.