How does that work though? How does one cell that has the same DNA as another cell "know" what proteins to produce? The answer is a word we use quite often, and that is, by "regulation." You see, at the end of the day, cells don't "know" anything. They don't think. They are just proteins and various molecules floating around and bumping into each other. And, if they happen to bump into each other, sometimes interesting things can happen. You see, it is all just about the "probability" of bumping into each other though. This is what we call cellular "noise."
Think of it like this. If there is a large concentration of a certain protein, there is a much higher probability that it will bump into something which can cause a reaction, which can cause some kind of event downstream. If there is a low concentration, sometimes there may be just a random chance of things bumping into each other, but it will be more rare. This is a form of cellular regulation.
So, this brings me back to the question, well why does one cell with the same DNA produce different proteins than the another cell? Simple, it has to do with the way DNA is packaged up. Unlike the common picture of the double helix you often see in TV, DNA in reality is covered in proteins. I won't go into the amazing amount of variability and functions of it all, so simply, in one cell, the DNA gets packaged up differently than others. For example, in one cell, the DNA will be "wound up" extremely tight in certain areas, whilst open in others. Where it is wound up tight, proteins are unable to bind to the DNA to activate the process of which proteins are derived from the DNA (Transcription > Translation). Where it is loose, they will bind. Ultimately, this is the core way one cell differs from the other, the way the DNA is packaged up. A liver cell will only have its cocktail of proteins able to be translated, whilst the others packed up, whilst other cells might have a very different regime of proteins to produce.
I should note that this is still poorly understood. We know a lot more now than we did 10 years ago, but a lot of thesis work is going on in this department cause it is incredibly complex. But that is just a side note, so I wouldn't worry about it here.
Now that you have this big picture (albeit simplified), we go back to your question, how do identical twins look different even though they have the same DNA? Well, one answer is that we have a field called epigenetics. What this is is that through environmental factors, modifications happen to the proteins that package the DNA (methylations), and for one person, through their own life choices, experiences, and environmental factors, the DNA may get packaged slightly different. These will not be extreme differences, as most cellular function must remain the same, but lets use an extreme example: The twins are separated at birth, and one goes to a very poor home and another to a well-fed home. Let's say several times in this child's life he didn't eat, or just ate less overall. Maybe that body went into a more "survival" mode and he just grew less tall, or more puny than his twin that was well-fed. The DNA modified its packaging to stop transcription of certain proteins or activate others that another person may not have, like their twin. Sometimes it might be as simple as lowering the expression of a protein by half in one person compared to the other. These modifications that happen due to environmental factors will carry on in each replication. Hence, it's not in the DNA code itself, but there is stored information that copies how the DNA is packaged as well, thus it's not true genetics, it is epigenetics. So, the twins end up looking different because some of these proteins affect the phenotype, or the outward, visible expression of a protein. For example, brown hair verse red hair are phenotypes. Short vs tall, etc. Some genes are related to various phenotypes, and these just may end up being expressed different from one twin to the next due to epigenetic modifications of their DNA.
There is another issue though. What if I told you that in a theoretical world, if both twins had 100% exactly the same environmental factors to face them through their whole life, that they still will most-likely not be perfect matches of each other? WHAT!? How is that possible? Remember how I talked about how in the cell things are just floating around and bumping into each other? Well, this noise is "stochastic," meaning random. In early cellular development, even if 2 cells side-by-side have the same cocktail of proteins and is the same scale, there is still only the "probability" of things bumping into each other enough to hit certain thresholds for certain signaling pathways to be activated. Early stochastic noise in the cell can actually cause fairly significant downstream differences. Maybe some early signaling for a growth factor ended up being 25% stronger just through "stochastic" noise. Now, through probability, most things will be the same, but also through probability, there is going to be some differences no matter what. This is also why if you took an animal and cloned it, the DNA may be the same, but it becomes nothing more than a "twin" who is not a perfect match due to the stochastic changes that occurred in early cellular development.Source