It sounds like your question is "what are the rules to protein folding?"
That's not the only way to read your question.
Protein Folding is a unique problem - a 1D sequence maps to a 3D object. Since proteins mediate nearly all biochemical transformations and therefore mediate life's processes, protein folding one of the great unsolved problems in science today.
You can see in the example folded structure above there are helices and flat sheets of connected strands. You can see below in the schematic alpha beta barrel motif of triose phosphate isomerase (TIM) how elegant these structures can be.

Although the combinations and overall organization of the beta sheets and the alpha helices are boundless, there are some unifying motifs in these structures.
Long ago, a couple of researchers tabulated the amino acids probability of being in alpha helices or beta strands. The Chou-Fasman model is important in that it has approximately ~70% chance of detecting alpha helices and beta strands. Its not a great accuracy but what's really amazing about these algorithms is that they show that local forces - the interaction of amino acids near each other in the sequence have something to do with the formation of at least alpha-helices and beta strands.
There have been pounds worth of papers written since then. In general, statistical surveys of protein sequences have been able to identify folds or motifs by a long list of string and machine learning algorithms. Hidden Markov Models and Bayesian profiles are popular. Of course all these are similar to Chou-Fasman in that they work on the sequence in short segments more or less.
For a while it was thought that molecular dynamics and other discrete simulations might help to solve protein folding by allowing long distance interactions to be involved. Just simulating the entire protein molecule in a computer program as it moves into a folded conformation, but this has not proven to be possible for a couple of reasons: (1) it takes a long time for a protein to fold relative to the length of a tractable simulation (2) the forces involved in protein folding and molecular size scales are not really easy to simulate - they do not precisely simulate the forces and behavior experienced by molecules and they involve many more solvent molecules than most computations can involve - even today's server farms would get clogged up with respectable protein folding simulation.
Since 1994 the Critical Assessment of Structure Prediction (CASP) have provided an open competition every 2 years where 3D structures that have been determined experimentally is held from publication. While its well attended a new class of algorithms showed up around 2000. These algorithms work on the assumption that local forces are important to protein folding, but often incorporating molecular dynamics. Using MD or statistics based on protein structures (see the RCSB for the repository), segments of the protein sequence are tested for structural tendencies. chaining these predictions together, initial protein folds are put together. Once put together long term interactions can assemble a protein structure.
BTW that is not to say that Protein folding is solved - the solutions that come out often produce a structure that is really similar to the final structure, but often there are substantial differences.
Just looking at the individual sequence there are no simple rules to decide how the protein fold - ultimately molecular physics of the individual sequence determines where the fold will go.
This is incredibly terse, but it could get you started. Study of protein without any helices or beta strands is a topic in itself - they can be treated the same way as above. Then there are also proteins who do not have a single fold, but are dynamic and flop around all the time, or only have a shape when in contact with a surface of some kind. So there's even more.