user12677: Having learned and gained complete mastery from the two most famous teachers of his time, he decided to apply extreme austerities for some six years. With these skills acquired, driving a powerful concentration,  he abandoned it all in favour of a skill he discovered when as a child at the Kings Plowing Ceremony, where he entered the first jhana [Dhyāna] quite effortlessly.
Furthermore, added to this cache of tools, he prior added a powerful determination to not move from that spot, even if his blood should dry up, etc, etc. The subsequent release of this energy resulted in a spectacular display of meditative attainment.
In the first watch of the night investigating Kamma with respect to successive past lives, revealing causal sequence. In the second watch of the night, investigating Kamma with respect to consequences of currently available choices. In the third watch of the night, the realisation of deliverance.
Not much is said about the results of the third watch. It is a fairly common experience where insights coming from seeing a new possibility after examining two different phenomena with a common factor giving rise to a eureka moment.
But what may have happened in this case, such a eureka event further resulting in a realisation that Dukkha had ceased? The Buddha's quest finally achieved.
During the next eight weeks, the problem of describing a way of enabling others to achieve this result, though necessarily not in the same way, given the death of the two teachers, plus avoiding austerities, plus the absence of psychic powers.
In developing a tangible expression for the inexpressible, the Buddha further developed the right view, that Dukkha exists, arises and ceases according to conditions. Enabling the further development of the 'noble eightfold path'. According to tradition, all this happened in an instant, that is to say, the sequence happened very rapidly: the problem is to give it coherent expression. The result: the four noble truths.

user17214: Ever get drunk?  How did you know you were drunk the first time it happened?  Enlightenment isn’t like being drunk, but like that state, entrance into it is unmistakable.  Upon reaching it, the scales fall away and the very experience of self and suffering is irrevocably and fundamentally altered.  The Buddha knew full well that this, what he had discovered, was utterly different from anything he had learned up to that point.  Enlightenment really does speak for itself.

user738: I am citing my answer to another question - Question
Part of my Answer:

When the Buddha (and so many other Buddhas) talk about no-self, they
  come from a direct experience of unity with everything. That is the
  source of “no self”. Their perspective is abolished. There is only
  truth for them. Unlike our experience where we are this body and mind
  and everything else is separate. And we have opinions about everything
  from our perspective.

Ever know the difference between Gautama and Buddha? Gautama is a person. Like you and me. Buddha is a general term given to one that knows the truth of everything. Buddha is one who has attained self realization. So, there are many Buddhas. 
So when Gautama attained to self realization he BECAME a Buddha. And when Gautama attains and becomes a Buddha, Gautama as a person is gone. There is only the knowing, Tathagatha. The knower takes a backseat. What we know as I, me, self (in this case Gautama) takes a backseat. So he just knows. 
This article highlights an important point like so

The Buddha asked himself similar questions, and after some years of searching came to extremely ­subtle, profound, and liberating truths—and these were truths, not beliefs; they were self-evident, obvious actualities. The view of himself as an individual, as ‘this person ­Siddhartha Gautama’, dissolved when he saw beyond thoughts, and he woke up as if from a dream. In consequence, he knew freedom from the horrors of the dreamlike existence that many, perhaps most, of us are engaged in right now. His life then opened out into the immediate, the spontaneous, that which is beyond thoughts, beyond views and opinions, and beyond habits and shadows of the mind.


user-1: I only read the title first - and user17's answer. I really don't get the story in OP.
But the title question strikes me, and it reminds me so much of L. Wittgenstein in his Tractatus. He tries to logically prove that 1+1=2, and in the end says something like: 
"Well somehow I deeply understand all this, but due do limitations of myself and of language I cannot explain in words. 
May my words be helpful for you as a throw-away ladder."

Now in Buddha's case a biological (man/nature) and spiritual (moral) enlightenment is also involved. And before I get lost (or raise protests) because I chop up enlightenment, I stop. 


How could the Buddha know that he had attained enlightenment when he
  didn't know what it was?

He felt it.
Where does this question or idea come from, if I may ask? 

user295: 
In the third watch of the night He had the knowledge of the exhaustion of cankers, knowing that He had eradicated all defilements and made an end of ill.

The Three Supreme Knowledges of Lord Buddha
So the Buddha knew he had overcome defilements and was enlightened due to knowledge of the exhaustion of cankers.
Also with the arising of knowledge of the exhaustion of cankers the Buddha knew what enlightenment was.

user11009: This is a great question. In Buddha's time, there were many other ascetics claimed that they have attained Nibbana. However, the definition of Nibbana was varied.
Buddha realised that the elimination of Dukkha is the Nibbana. Then he defined the Dukkha with his revolutionary definition including Sankhara Dukka.
He realised the cause of Dukkha is the craving. He also realise that the way to eliminate craving is to follow the Noble Eightfold Path. He also discovered the way to stop Dependent Origination'
The night he enlightened he knew that he does not have any craving. This process is called the review.Paccavekkhana ñana: 
https://en.wikipedia.org/wiki/Vipassan%C4%81-%C3%B1%C4%81%E1%B9%87a
He also the first person to realise not self-nature of our existence.

12677: <p>Having learned and gained complete mastery from the two most famous teachers of his time, he decided to apply extreme austerities for some six years. With these skills acquired, driving a powerful concentration,  he abandoned it all in favour of a skill he discovered when as a child at the Kings Plowing Ceremony, where he entered the first jhana [Dhyāna] quite effortlessly.</p>

<p>Furthermore, added to this cache of tools, he prior added a powerful determination to not move from that spot, even if his blood should dry up, etc, etc. The subsequent release of this energy resulted in a spectacular display of meditative attainment.</p>

<p>In the first watch of the night investigating Kamma with respect to successive past lives, revealing causal sequence. In the second watch of the night, investigating Kamma with respect to consequences of currently available choices. In the third watch of the night, the realisation of deliverance.</p>

<p>Not much is said about the results of the third watch. It is a fairly common experience where insights coming from seeing a new possibility after examining two different phenomena with a common factor giving rise to a eureka moment.</p>

<p>But what may have happened in this case, such a eureka event further resulting in a realisation that Dukkha had ceased? The Buddha's quest finally achieved.</p>

<p>During the next eight weeks, the problem of describing a way of enabling others to achieve this result, though necessarily <em>not</em> in the same way, given the death of the two teachers, plus avoiding austerities, plus the absence of psychic powers.</p>

<p>In developing a tangible expression for the inexpressible, the Buddha further developed the right view, that Dukkha exists, arises and ceases according to conditions. Enabling the further development of the 'noble eightfold path'. According to tradition, all this happened in an instant, that is to say, the sequence happened very rapidly: the problem is to give it coherent expression. The result: the four noble truths.</p>
 17214: <p>Ever get drunk?  How did you know you were drunk the first time it happened?  Enlightenment isn’t like being drunk, but like that state, entrance into it is unmistakable.  Upon reaching it, the scales fall away and the very experience of self and suffering is irrevocably and fundamentally altered.  The Buddha knew full well that <em>this</em>, what he had discovered, was utterly different from anything he had learned up to that point.  Enlightenment really does speak for itself.</p>
 738: <p>I am citing my answer to another question - <a href="https://buddhism.stackexchange.com/questions/23476/how-to-live-life-after-acknowledging-anatta/23483#23483">Question</a></p>

<p>Part of my Answer:</p>

<blockquote>
  <p>When the Buddha (and so many other Buddhas) talk about no-self, they
  come from a direct experience of unity with everything. That is the
  source of “no self”. Their perspective is abolished. There is only
  truth for them. Unlike our experience where we are this body and mind
  and everything else is separate. And we have opinions about everything
  from our perspective.</p>
</blockquote>

<p>Ever know the difference between Gautama and Buddha? <code>Gautama</code> is a person. Like you and me. <code>Buddha</code> is a general term given to one that knows the truth of everything. Buddha is one who has attained self realization. So, there are many Buddhas. </p>

<p>So when Gautama attained to self realization he <em>BECAME</em> a Buddha. And when Gautama attains and becomes a Buddha, Gautama as a person is gone. There is only the knowing, <code>Tathagatha</code>. The knower takes a backseat. What we know as I, me, self (in this case Gautama) takes a backseat. So he just knows. </p>

<p><a href="https://buddhismnow.com/2012/07/13/two-ways-not-to-go-by-diana-st-ruth/" rel="nofollow noreferrer">This article</a> highlights an important point like so</p>

<blockquote>
  <p>The Buddha asked himself similar questions, and after some years of searching came to extremely ­subtle, profound, and liberating truths—and these were truths, not beliefs; they were self-evident, obvious actualities. The view of himself as an individual, as ‘this person ­Siddhartha Gautama’, dissolved when he saw beyond thoughts, and he woke up as if from a dream. In consequence, he knew freedom from the horrors of the dreamlike existence that many, perhaps most, of us are engaged in right now. His life then opened out into the immediate, the spontaneous, that which is beyond thoughts, beyond views and opinions, and beyond habits and shadows of the mind.</p>
</blockquote>
 -1: <p>I only read the title first - and user17's answer. I really don't get the story in OP.</p>

<p>But the title question strikes me, and it reminds me so much of L. Wittgenstein in his <em>Tractatus</em>. He tries to logically prove that 1+1=2, and in the end says something like: </p>

<p>"Well <em>somehow</em> I deeply understand all this, but due do limitations of myself and of language I cannot explain in words. </p>

<p>May my words be helpful for you as a throw-away ladder."</p>

<hr>

<p>Now in Buddha's case a biological (man/nature) and spiritual (moral) enlightenment is also involved. And before I get lost (or raise protests) because I chop up <em>enlightenment</em>, I stop. </p>

<hr>

<blockquote>
  <p>How could the Buddha know that he had attained enlightenment when he
  didn't know what it was?</p>
</blockquote>

<p>He felt it.</p>

<p>Where does this question or idea come from, if I may ask? </p>
 295: <blockquote>
  <p>In the third watch of the night He had the knowledge of the exhaustion of cankers, knowing that He had eradicated all defilements and made an end of ill.</p>
</blockquote>

<p><a href="https://www.arrowriver.ca/dhamma/tivijja.html" rel="nofollow noreferrer">The Three Supreme Knowledges of Lord Buddha</a></p>

<p>So the Buddha knew he had overcome defilements and was enlightened due to knowledge of the exhaustion of cankers.</p>

<p>Also with the arising of knowledge of the exhaustion of cankers the Buddha knew what enlightenment was.</p>
 11009: <p>This is a great question. In Buddha's time, there were many other ascetics claimed that they have attained Nibbana. However, the definition of Nibbana was varied.
Buddha realised that the elimination of Dukkha is the Nibbana. Then he defined the Dukkha with his revolutionary definition including Sankhara Dukka.
He realised the cause of Dukkha is the craving. He also realise that the way to eliminate craving is to follow the Noble Eightfold Path. He also discovered the way to stop Dependent Origination'
The night he enlightened he knew that he does not have any craving. This process is called the review.Paccavekkhana ñana: </p>

<p><a href="https://en.wikipedia.org/wiki/Vipassan%C4%81-%C3%B1%C4%81%E1%B9%87a" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Vipassan%C4%81-%C3%B1%C4%81%E1%B9%87a</a></p>

<p>He also the first person to realise not self-nature of our existence.</p>
