You will need to first copy the template file from the buddypress plugin.
Then, paste a copy of the file into your child theme using the exact folder structure after bp-legacy.
[name of your parent theme]-child/buddypress/activity/activity-loop.php
Lastly, you will need to edit the activity-loop.php file in accordance with the BuddyPress codex. The friend code is linked here: https://codex.buddypress.org/developer/loops-reference/the-activity-stream-loop/#filtering-examples