Answer :

Because the inside is the area, and the outside or exactly on the line is the perimeter 
Counting the 'spaces' inside the grid refers to finding the area of the shape, as that's what surface area is: the amount of space inside the shape, so the number of a certain size of spaces inside a grid. The perimeter is completely different. It is the distance around the side of the shape, i.e. the sum of the length of each of the shape's sides.