Different elements can combine together to share the electrons. When this happens, chemical compound is formed. One of the common compounds is water, the result of 2 hydrogen atoms joining with an atom of oxygen. There are thousands of different chemical compounds which occur in nature.
A compound is different than a mixture of elements. If hydrogen and oxygen are mixed, the result is a colorless, odorless gas, just like either element is a gas distinctly. A sparkz, will cause the molecules to combine together; this will liberate energy in the form of light and heat. Under the right conditions, there will be a violent explosion, because the 2 elements combined eagerly. Water is chemically explained in Figure drawn below
Figure--Simplified diagram of a water molecule.
Compounds often, appear greatly different from any of the elements that make them up but not always. At room temperature and pressure, hydrogen and oxygen both are gases. But water under same conditions is a liquid in state. If it gets hot, water becomes a gas, colorless, odorless like hydrogen or oxygen.
The other common example of a compound is rust. This forms when iron combines with oxygen. Though iron is a dull gray solid and oxygen is a gas, rust is a maroon-red or brownish powder, unlike either of the elements from which it is formed.