The Vaastu Purusha is the deity or God, the divine being responsible for the strength, harmony, success and happiness of the house. He is the personification of the land on which a house or building stands. He is said to be lying with his face down and his head facing North-East, both his feet on the South-West, right arm and right knee on the South-East, and left arm and left knee on the North-West, thus regulating the energies of the house.
The story of the Vaastu Purusha is given in Matsya Purana as follows:
Once Lord Shiva, embodiment of light & knowledge, was engaged in a fierce battle against "Andhaka" the most powerful and cruel demon representing blindness/darkness/ignorance. During the long fight Lord Shiva got profuse sweating and when the sweat drops fell on the ground (sweat is ruled by Saturn), there emerged an exceptionally strong being. He looked cruel and started devouring and eating everything that came his way. To contain him, 45 Gods at once pounced simultaneously on him and held him to the ground face down. Unable to overpower the 45 gods, this strong man prayed to Lord Brahma (the deity of Saturn according to sage Parashara), Lord Brahma got pleased with his prayers and blessed him saying, "he will be the deity of all plots and offerings will have to be done to him". He was Vaastu Purusha and so he became responsible for the well being of the inhabitants of every dwelling.
The Brihat Samhita gives the description of the Vastu Purusha as, "There was, exceptionally strong and large being created (by Lord Shiva), which obstructed the earth and the sky with his body. The gods suddenly caught hold of him having thrown and laying him upside down. Each god caught hold of his different limb and those very gods became the presiding deities of those parts. The creator, Lord Brahma, intervened and ordained that being, the Vaastu Purusha to be the deity of every home. ".
The Vaastu-Vidhaana of Narada says that "the Vaastu Purusha-Mandala (geometrical) is the magical diagram (Yantra) and the form (roopa) of the Vaastu Purusha. It is his body (sharira) and a bodily device (sharira-yantra) by which those who have requisite knowledge attain the best results".