Let us take two different examples
When you rub fur with ebonite rod, the chemical bond is formed between some parts of the the two surface. Rod has its electron more tightly bound than fur. So, fur donates electrons to the rod while electrons from rod won't come out. Due to excess of electrons in rod, it becomes negatively charged while the fur with lost electrons, becomes deficient of electrons. Thus, fur becomes positively charged.
When a glass rod is rubbed with silk, electrons are transferred from the glass rod to the silk. Since the glass rod losses electrons, it becomes rich in positive charge. Similarly, the silk cloth becomes negatively charged.