3DES works by using two keys of 56 bits each with a key length of 112 bits. With 3DES, to encrypt the source text, it is first encrypted with key 1. In the second stage, encryption or decryption can take place, usually with key 2, as well as in stage 3, for which again key 1 is used. It has no cryptographic relevance whether encryption or decryption takes place in the second or in the following stage. However, the same key should not be used three times.
There is another variant with three different keys of 56 bits each, i.e. a key length of 168 bits.
For decryption, the encrypted text is converted back to the original text in the same encryption and decryption chronology.