I have a cylinder and I'm wondering how can I rig and make the two-part of it rotate? Do I have to divide it or there is any solution?
You have to separate it to work properly.
You could only rotate it in opposite directions in edit mode and be using shape keys to animate it, but it will mess the topology.
The easier way to do it is: delete the upper or down portion in edit mode and, in object mode, duplicate that object for further rotations or whatever.
I suggest you enter: https://blender.stackexchange.com/
Thare you will find a lot of people to help you better.