You can create an account group by going to Finances -> Accounts and transactions -> Account Groups and click "Create account group.
In addition, you can go to the "Groups" tab in the account selector and click "Create account group".
After clicking the button, give your group a name and select the accounts that you want to be part of the group. When you are done, click "Save group".