Two articles with good step-by-step:
https://www.cnet.com/how-to/how-to-root-the-samsung-galaxy-ace-2/
https://www.cnet.com/how-to/how-to-install-jelly-bean-on-the-samsung-galaxy-ace-2/
Backed up here: How to root the Samsung Galaxy Ace 2 – CNET + How to install Jelly Bean on the Samsung Galaxy Ace 2 – CNET
I have instead of Jelly Bean installed 12.1
I ended up with good install after first try. First booting took minutes.
I have also problems right now: phone vibrates/freezes for a second every two minutes + I can’t call
More links:
Newer but may be buggy:
http://forum.xda-developers.com/galaxy-ace/ace-2-develop/rom-cyanogemod-13-sergeyl-t3277418
Cyanogenmod walkthrough that did not work for me:
How to Enable Developer Options for Debugging on Stock Android or CyanogenMod or Custom ROMs
How to Install TWRP recovery on Any Samsung Android Using Odin
How to Unlock Bootloader on Any Android Phones Using Fastboot