How to automatically activate a plugin on install

You need to reference the correct path in order for WordPress to know what to activate.

For activate_plugin, it should be activate_plugin( 'plugin-name-folder/plugin-name.php' );.

For deactivate_plugins, it should be deactivate_plugins( '/plugin-name-folder/plugin-name.php' );.