Primary structure is the order in which what amino acid is bound the other with a peptide bond. This is coded for by the order of codons in a gene.
Secondary structure is how the chains on amino acids interact with each other to form beta barrels and alpha helixes. This structure is determined by hydrogen bonds between the different amino acids.
Tertiary structure is when the secondary structures interact with each other through disulphide bonds, hydrogen bonds, hydrophobic/hydrophilic interactions etc. This is all determined by the placement of certain amino acids within the proteins secondary structure.