After the fertilization when the zygote is in the growing state to a foetus, the main canal is introduced first, from mouth to anus. But my question is when the canal is created first how does it determine which side is for mouth and which side is for anus?
The gut tube is formed from endoderm that migrates through the primitive streak. Before this, however, the anterior-posterior axis of the embryo is defined by the formation of the streak at the beginning of gastrulation. In mice, which are phylotypic with humans at this stage, the streak forms posteriorly and then extends to the anterior. I'm not sure if you'll be able to find much research on humans, but mice and chicks are quite well studied. That said, I don't know the molecular and cellular mechanisms which define where the primitive streak forms. I don't even know if it is known. How much detail are you looking for? If I find the time, I can try and elaborate on this further. In the mean time, this review looks promising: