How do I automate the export different layers combinations ( turning on and off ) in After Effects
Templater can do this.
https://aescripts.com/templater/
You feed it a load of google (or excel or CSV) tables, with specified values, and it can churn through a load of files to export different comps with different arrangements.