You can control which tickets can be merged into (target ticket) by adding conditions.
Add conditions as you normally would for views or triggers in Zendesk. Status, Group, and Form are currently the only available fields. If you don't add a condition, Auto Merge will merge into any non-closed ticket (Status > Less than > Closed) by default.
To control which tickets can initiate auto merging, update the conditions in your Auto Merge Trigger.