This array formula**:

=IFERROR(AVERAGE(IF(TEAM[ACT]="X",IF(ISNUMBER(MATCH(TEAM[POS],{"LW","AG"},0)),TEAM[AGE]))),"-")

** array formulas need to be entered using the key
combination of CTRL,SHIFT,ENTER (not just ENTER).
Hold down both the CTRL key and the SHIFT key
then hit ENTER.