Luke 9:33

33 As the men were leaving Jesus, Peter said to him, “Master, it is good for us to be here. Let us put up three shelters—one for you, one for Moses and one for Elijah.” (He did not know what he was saying.)

Read Luke 9:33 Using Other Translations

And it came to pass, as they departed from him, Peter said unto Jesus, Master, it is good for us to be here: and let us make three tabernacles; one for thee, and one for Moses, and one for Elias: not knowing what he said.
And as the men were parting from him, Peter said to Jesus, "Master, it is good that we are here. Let us make three tents, one for you and one for Moses and one for Elijah"--not knowing what he said.
As Moses and Elijah were starting to leave, Peter, not even knowing what he was saying, blurted out, “Master, it’s wonderful for us to be here! Let’s make three shelters as memorials —one for you, one for Moses, and one for Elijah.”

What does Luke 9:33 mean?

John Gill's Exposition of the Bible
Luke 9:33

And it came to pass, as they departed from him
That is, as Moses and Elias departed from Christ; or "when they began to depart", as the Syriac version renders it; or "would depart", as the Arabic and Persic versions; seemed desirous of going, or made some signal or other by which the disciples perceived they were about to go; for, as yet, they were not gone;

Peter said unto Jesus, master, it is good for us to be here, let us
make three tabernacles, one for thee, and one for Moses, and one for
Elias; (See Gill on Matthew 17:4)

not knowing what he said,
nor "what to say", as Mark observes, being in a surprise, and not in a situation to consider and weigh things well, whether what he said was right and proper, or not; (See Gill on Matthew 17:4)

California - Do Not Sell My Personal Information  California - CCPA Notice