The base templates that BP looks for in order of priority are:
plugin-buddypress.php
buddypress.php
community.php
generic.php
page.php
single.php
index.php
If you are on a single group page, BuddyPress will use the following template hierarchy:
If you are on a single member page, BuddyPress will use the following template hierarchy: