How did physicists know that there are two kind of charges? Problems
The question I am about to make is either too stupid or hasn't bothered anyone because its obvious because I can't really find the answer anywhere.
I am currently studying electricity and magnetism and my book starts by telling that matter consists of atoms that are made of a heavy positively charged nucleus and a cloud of light negatively charged electrons orbiting around it and it bases the rest of the book on these facts.
However electricity, positive and negative charges were studied before the atomic theory was confirmed. Actually at that time it wasn't even remotely supported. Benjamin Franklin for example thought that electrical charge was some kind of cloud/gas. When there was abundance of this cloud the charge was positive while otherwise it was negative.

Questions
Firstly, I suppose that classically we define charge as the physical property that objects have to have in order to interact electrically - at least for now.


*

*How did physicists back then know about the existence of two charges, positive and negative? Sure, if you bring two glass rods close after rubbing them with silk they repel each other, while if you bring glass rod and one plastic rod they attract each other, but is that really enough?

*Moreover, how did they know that opposite charges attract while same charges repel each other? You can't arbitrarily choose to be so, since electrons really do repel each other. Was there a way to tell that a glass rod had abundance of that cloud after the rubbing while the plastic had a deficit?

In my book it is said that Franklin, after a series of experiments, determined that there are two kinds of charges without elaborating. I cannot find those experiments anywhere. All I get is about the famous kite experiment.
 A: There are some good answers here, but I think I want to try to abstract Franklin's work a little bit. Because Franklin found just two options - "repel" and "attract", he was forced to consider only two kinds of charges.
Consider the experiment, where glass-glass repels, plastic-plastic repels, and glass-plastic attracts. If all glass is the same, the glass must be creating the same kind of charge (call it, "glass charge"). Plastic obviously has another kind of charge (since it repels). so plastic has "Plastic charge". The rule for "charges" is that "like charges repel", and "unlike charges attract".
So we don't get told the rest of the story, but presumably he did this with many other materials, and found that some repelled, and some attracted. He could have labeled them all different and added more rules (metal charges, wood charges, water charges, etc), but if you have only two results ("attract" and "repel"), each pair of objects can only do one of those two things.
So he could have tried triples of objects, to see if this was only a binary effect, but because there are only two (electric) charges in nature, he would have found that out. And of course, if he had worried about the size of the effect, he might have worked out many different kinds of charges ("plastic charges" being much bigger then "wood charges", but probably smaller then "metal charges"), but since he was looking at binary data, he was forced to only consider binary answers.
A: Get together a collection of charges. As many different ways to generate a charge as you can think of. Go ahead and invite your friends so they can think of some more. (As a practical matter you make static charges just before you use them, but still...)
Now, test them pair wise to see if they attract or repel one-another. Keep careful records.
Find the largest set that are all mutually attractive and the largest set that are all mutually repulsive.
You'll find that the attractive set has exactly two members (though you can make many different examples of this set) and the repulsive set consists of half (either half!) the charges you've created.
Ponder that for a while. It also gives you the answer to how like charges respond to one another (though you can get that directly by preparing two similar charges).
A: I agree with DanielSank that the question is asking (wholly, not partly) about the historical development of the concept of electrical charge, not our modern description of it - "how did they know?" not "how can we know?"  The latter (answered by dmckee) is the end result of more than two centuries of observation, experiment, theorising and debate, and ignores theories which looked promising but were rejected.  It uses hindsight which our ancestors did not have.
Your textbook describes the present day model of electric charge, and only alludes to the historical development of ideas. Compared with today, this was hampered by mysticism and superstition, and poor communication between the few people who had the resources to carry out scientific investigation.
Static electricity and magnetism were initially thought to be the same phenomenon.  Both were known to the ancient Greeks (amber = 'elektron', black lodestones were abundant in Magnesia).  They were 1st distinguished by William Gilbert around 1600 ('De Magnete' http://www.gutenberg.org/ebooks/33810).  He described static electricity as a fluid released by rubbing, and classified materials as 'electrics' (those which could be electrified) and 'non-electrics' (those which could not).  About 1620 Niccolo Cabeo discovered that electricity can repel as well as attract.
The first (static) electric generator was invented in 1660.  In 1729 Stephen Gray discovered electrical conduction, re-classifying materials as conductors and non-conductors.  In 1733 Charles Francois du Fay discovered that electricity comes in two forms which he called resinous (-) and vitreous (+).  The Leyden Jar, the original capacitor, to store and release electrical charge, was invented in 1745.  Benjamin Franklin's major achievement was to show that atmospheric electricity (lightning) and static electricity generated in the laboratory, are the same phenomenon. 
Du Fay's report of "two kinds of electrical fluid" was published in Philosophical Transactions in 1733.  In it he stated the law that "like charges repel, opposites attract."  He showed that all bodies, both solids and liquids, could be electrified.  His classification of the electricity itself, rather than the materials which can produce or conduct it, was a breakthrough idea in the understanding of electricity.
http://rstl.royalsocietypublishing.org/content/38/427-435/258.full.pdf+html?sid=c8642e49-7dd2-488e-b815-f031c1bb6afb
Franklin's findings and ideas were published as Experiments and Observations on Electricity (1751). His single fluid model rivalled the two fluid models of Du Fay and Abbe Jean-Antoine Nollet. He explained one fluid (negative) as the absence of the other fluid (positive).  He coined several electrical terms which we still use today, including charge, conductor, plus, minus, positively, negatively. 
https://archive.org/details/experimentsobser00fran

I think you are correct.  There do not seem to be many histories of ideas in electricity and magnetism.  One possibility (probably available only in major libraries) is : 
A History of Electricity: (The Intellectual Rise in Electricity) from Antiquity to the Days of Benjamin Franklin
Park Benjamin, J. Wiley & Sons, 1898 - 605 pages
A: Let's assume we don't know how many types of charges exist.
But we know that there are bodies which either attract or repel each other.
Now we perform an experiment 


*

*We find all such bodies that repel each other and put them in separate categories. 

*After extensive experimentation we observe that they only belong to two piles.

*Furthermore we also observe that the objects in the two different piles attract each other.

*We can define one of them as positive and the other as negative arbitrarily.
A: Among competing hypotheses, the one with the fewest assumptions should be selected.
Some electrified objects repel, some attract.  This can be explained by two kinds of charge.  Nothing that cannot be explained by two charges can be explained by adding a third kind of charge.  So we continue to describe electricity as occurring in two kinds.
