It is implied that Zechariah was in God's temple and that these priestly duties were part of worshiping God. (See: [[rc://en/ta/man/translate/figs-explicit]])
A lot was a marked stone that was thrown or rolled on the ground in order to help them decide something. The priests believed that God guided the lot to show them which priest he wanted them to choose.
# to burn incense
The priests were to burn sweet-smelling incense as an offering to God each morning and evening on a special altar inside the temple.
# The whole crowd of people
"A large number of people" or "Many people"
# outside
The courtyard was the enclosed area surrounding the temple. AT: "outside the temple building" or "in the courtyard outside the temple" (See: [[rc://en/ta/man/translate/figs-explicit]])
# at the hour
"at the set time." It is unclear if this was the morning or evening time for the incense offering.