Thats easy - you get 3 if you use a vector or matrix with just three rows. 😉
But the vector M you created has six elements for reason which Terry already explained. So its correct to say that has six rows.
Give it a try yourself and type M= You will see a six rows vector.
BTW, when you try rows(i) or rows(M[i) you feed the elements 3,4,5 one after the other in the rows() function. Each of these values is a scalar, not a matrix or vector and so the row() function returns 0 for every of these three values and thats the reason for the vector with three zeros you get as a result.
If you want to create a three element vector with the values 3,4,5, here is the way to go