To set a units attack animation go to the unit’s blueprint like for example the BP_SoldierUnit and in the Class Defaults search for the Attack Animation settings.

Here you can click the + button to add a new attack animation, you can also add multiple entries and the unit will randomly select one of the animations when they attack.

In your attack animation montage make sure the montage slot is set to the DefaultSlot like the video below.