How to write columns data in rows in specific format using Awk

The following variant introduces a new variable tc, triplet counter.

awk '
  { key=($1 OFS $2 OFS $3 OFS $4 OFS $5) }
  key!=pkey { printf (nl nl "%s"), key; pkey=key; nl="\n"; tc=0 }
  { d=(tc?OFS:"\n"); printf d"%s %s %s", $6, $7, $8; tc=(tc+1)%3 }
  END { printf nl }
' input

The %3 lets tc cycle thru 0 1 2, printing a newline for 0 and a space otherwise.
So you can easily adjust the number of triplets per row.