1. Brahma Purana (Mount Sumera) :-
There was a war between the gods and the demons and the gods lost. The gods came to Brahma for advice and Brahma asked them to pray to Shiva.
When Shiva appeared before them, the gods said, “The demons have defeated us. Please kill them and save us.”
Shiva went to fight with the demons. He drove the demons off from Mount Sumeru and out of heaven. He pursued them to the ends of the earth. All this exertion made Shiva sweat. And wherever the drops of sweat fell down on the ground, terrible ogresses named matris were created. The matris also started to kill the demons and pursued them down to the underworld.
While the matris were killing the demons in the underworld, Brahma and the other dos waited on the banks of the river Goutami Ganga. This place came to be known as Pratishthana.
When the matris had killed all the demons, they returned to earth and began to live on the banks of the Goutami Ganga. This tirtha has come to be known as matritirtha.
Brahma used to have five heads. The fifth head was in the shape of a donkey’s head. When the demons were running away to the underworld, this donkey’s head addressed the demons and said, “why are you running away? Come back and fight with the gods. I shall aid you in your fight.”
The gods were alarmed at this paradoxical situation. Brahma was helping them in their flight with the demons and Brahma’s fifth head was trying to help the demons. They went to Vishnu and said, “Please cut off Brahma’s fifth head. It is causing too much of confusion.”
“I can do what you want,” replied Vishnu, “but there is a problem. When the cut-off head falls on earth, it will destroy the earth. I think you should pray to Shiva to find a way out.”
The gods prayed to Shiva and Shiva agreed to cut off the head. But what was to be done with the severed head? The earth refused to bear it and so did the ocean. Finally it was decided that Shiva himself would bear the head.
The place where Shiva cut off Brahma’s fifth head is known as rudratirtha. Ever since that day, Brahma has had four heads and is known as Chaturmukha (chatur connotes four and mukha connotes face). There is a temple to Brahma on the banks of the Goutami Ganga. This is a holy place known as brahmatirtha. A killer of brahmanas is pardoned his sin if he visits this temple.
2. Brahma lied :-
Brahma lied that He had seen the top of Shiva's head -- the idea being that He had seen the "ends/beginning" of Truth/Time (represented by Shiva).
The Story...
Brahma at one point developed a significant ego claiming that he was the 1st of the trimurtis and should thus be worshipped over all. In discussing with his consort Sri Lakshmi, Lord Narayana is laughing saying “It is difficult enough when one head becomes full of ego; how much more difficult is it when all four of Brahmas heads are filled with egotistic pride?” Narayana and Shiva decide to teach Brahma a lesson. Shiva is of the opinion that Narayana is clearly the greatest, as He has the most difficult of responsibilities (sustenance is harder [requires proactive management] than either creation or dissolution). Narayana says "I have never seen the top of Shiva's head, so Shiva is clearly the greatest of us all, as He is beyond all knowledge." To resolve the dilemma, Shiva then says, let's pose a challenge that whosoever sees the top of my head is the greatest of the three. Brahma and Narayana accept the challenge. Brahma proceeds aggressively to locate the top of Shiva's head. Narayana gives up part way saying "As we keep going higher, Shiva's head continues to go on for eternity, there is no way that we will succeed, let us give up now and accept Shiva as the greatest of all." Brahma undeterred, proud, vain, and haughty keeps going upwards with the aim of seeing the top; Narayana returns after going part way, and upon prompting from Saraswati devi, He takes a different approach. He tells Saraswati, that "in this form, even I cannot see the top" and proceeds to take the Varaha avatar (boar) to dig into the bowels of creation to find Shiva's feet -- when he locates Shiva's feet and touches them, Shiva looks down with surprise to see who touched his feet, giving Narayana the opportunity to see the top of Shiva's head -- thus, proving the point that intellectual/egotistical efforts (like Brahma's method of trying to go "upwards" to find the top) will never lead to the ultimate knowledge, as knowledge itself keeps going on and on and on (knowledge is a limitless ocean), only self surrender at the feet of the Lord will enable you to attain that ultimate knowledge, knowing which, all else becomes known.
Here Shiva only curses Brahma that he will never be worshipped as God sbecause he had told a lie to win the competition -- Brahma uses falsified circumstantial evidence of the flower that fell from Shiva's head to say that He had seen the top, with a "white lie" saying "seeing the flower which fell from His head, is equivalent to seeing the top of His head." Thus, Shiva bans the use of this flower in His worship henceforth, and curses Brahma that he will never be worshipped by humans. In some versions, Shiva cuts off Brahma's 5th head because he lied with that head.
On the other hand, Shiva is profoundly astonished by Narayana's clever solution that enabled him to enact a "play within a play" in order to demonstrate this tattvam (principle) to Brahma.
The story also points out that mere intellectual efforts are insufficient for attaining the Supreme; one must, like a Boar, have dogged determination and intense bhakti to seek out the feet of the Supreme Lord, to attain the goal. The moral of the story being "those who speak the Truth in all circumstances are true devathas".
In this we can also see the tattvam of how Shiva worships Narayana, and how Narayana worships Shiva.
3. Dakshina Kali :-
As per Satpatha Brahmana, Brahma created a woman named Usha, who was epitome of feminity. Upon seeing her, Brahma was sexually aroused and approached his own daughter. He forced himself on her and they mated. At this, Lord Shiva appeared in the form of Bhairava and beheaded Brahma.
In Shiva Purana and Kalika Purana, slight variations are introduced. Brahma creates twins, Sandhya and Kama along with Saptarishis. He bestows boon of wooing over Kama, as a result the wicked one tests his lust arrows on Brahma himself, who spills his semen virile while staring at Sandhya lustfully. Lord Shiva appears and rebukes Brahma for his passionate nature.
Thus humilliated by Lord Shiva, Brahma curses Kama to be killed by Lord Rudra. Also, to avenge his humilliation, Brahma requests Adi Parashakti to incarnate and woo Lord Shiva. In due course, She incarnates as Sati, the daughter of Prajapati Daksha and wins Lord Shiva by observing Nanda Vratam. Her marriage is arranged and Brahma is appointed the officiating priest. While Lord Shiva and Sati complete the Saptapadi ritual, Brahma lustfully stares at Sati's feet and spills his semen virile. He collects it in his Kamandalu and presses his penis with his feet so that no one notices. Sati feels disgusted by Brahma's act and an enraged Lord Shiva severes Brahma's fifth head then and there.
We find another version in Vamana Purana. Devas are terrified of an Asura called Dundubhi, and they seek refuge of Lord Shiva. Lord wages a fierce battle against Asuras and kills Dundubhi with his trident. Then He chases the escaping Asuras. While Brahma is seeing this, his fifth head, that resembles head of a donkey, speaks out "don't run. I will protect you". A furious Lord Shiva now grabs Brahma by his throat and severes the fifth head.
This are 3 stories from Puranas about Brahma 5th head.