Only electrons move when an object becomes charged. The protons are fixed in the nuclei of atoms and cannot move. When two insulators are rubbed together, electrons are transferred from one surface to the other.
The object that gains electrons has more negative charge than positive charge, so it becomes negatively charged. The object that loses electrons has more positive than negative charge, so it becomes positively charged. For example, when a polythene rod is rubbed with a cloth, electrons move from the cloth to the rod. The rod becomes negative and the cloth becomes positive.
A gold leaf electroscope shows this. A charged rod touching the metal cap shares charge with the stem and the leaf. Both now have the same charge, so they repel and the leaf rises. The more charge on the electroscope, the more the leaf rises.