How does one substance become positively and other other negatively?

It's about static electricity.

I know when you rub two objects together, one will become positive and the other will become negative but how? Does it lose electrons..?

Basically one object has excess electrons. You can read more about it here.

http://en.wikipedia.org/wiki/Static_electricity

When two objects are rubbed together, such as a comb and a piece of paper, it can create static electricity. In order to understand how this happens, we need to explore the concept of electrons.

Atoms, which make up everything around us, consist of positively charged protons, uncharged neutrons, and negatively charged electrons. Normally, atoms have an equal number of protons and electrons, resulting in a neutral charge. However, when objects are rubbed together, a transfer of electrons can occur.

Let's consider the example of rubbing a comb against a piece of paper. The comb is made of a material that tends to attract electrons more strongly than the paper does. As the comb and the paper come into contact and are rubbed together, the atoms in the comb will take electrons from the atoms in the paper. This results in an excess of electrons in the comb, making it negatively charged. At the same time, the paper loses electrons, leaving it with a positive charge.

This transfer of electrons creates an imbalance of charges between the two objects, resulting in static electricity. The comb now has an excess of negatively charged electrons, while the paper has fewer electrons, leading to a positive charge.

So, to answer your question, when objects are rubbed together, the process of electron transfer occurs. The object that attracts electrons more strongly will gain electrons and become negatively charged, while the object that loses electrons will become positively charged.

To summarize, when objects are rubbed together, one becomes positively charged and the other becomes negatively charged due to the transfer of electrons from one object to the other.