They start with identical genes, because each is formed from a single fertilised egg that splits into two embryos. But from that moment onwards, their DNA begins diverging. The DNA replication mechanism introduces about one new mutation for every 100 million base pairs copied, per generation. There are around three billion base pairs in the human genome, so you would expect between 10 and 100 new mutations per person that occur early enough in embryonic development to be present in most cells in the body.
Ordinary DNA tests won’t normally detect this because they only examine a short section of the DNA, in a region known to be highly variable between individuals. But if the entire genome were sequenced, these differences would show up. In France a case of multiple rape, in which identical twin brothers were both suspects, was solved in this way in 2012. Your DNA also gets modified by epigenetic mechanisms such as DNA methylation. This changes the chemical structure of the DNA and affects how active certain genes are, based on diet and other lifestyle differences. So identical twins that have lived different lifestyles could also be genetically distinguished in this way.