Rank of a matrix based on its pivot elements In the example given in this Wikipedia article, I wonder if the last step is necessary to get its row echelon form. Why is it done? We have an upper triangular matrix in the previous step and we can then see its rank is equal to its non-zero rows which is two. 
My other question is, what does it mean when it says the rank is the number of pivots (which is means the number of columns?)? There are three columns in the above example but the rank is not three. Any clarifications would be greatly appreciated. 
Here's the image for your convenience: 

 A: number of pivot elements indicate number of independent rows or columns in given matrix ,which is on the other  hand  ,exactly rank of matrix,in your case we have two leading $1$,it means that rank is equal to  $2$
A: 
I wonder if the last step is necessary to get its row echelon form.
  Why is it done? We have an upper triangular matrix in the previous
  step and we can then see its rank is equal to its non-zero rows which
  is two.

The last step isn't necessary. It was already in row-echelon form on the second to last step.  

My other question is, what does it mean when it says the rank is the
  number of pivots (which is means the number of columns?)? There are
  three columns in the above example but the rank is not three. Any
  clarifications would be greatly appreciated.

A pivot is the first non-zero entry in a row. It doesn't have to be $1$ The matrix is in reduced row-echelon form when: $(1)$ it is the row echelon form. $(2)$ all the pivots are equal to $1$ and $(3)$ all the entries in the pivot columns are equal to $0$ except the pivots themselves. 
The last manipulation puts it in reduced row echelon form by removing the $2$ in entry $A_{12}$ so that column $2$ has zeros everywhere but the $2$nd row.
As for the last point, the rank is the number of pivots but pivots can't be zero as you see which makes the rank $2$. 
