This is an optimization problem. See the diagram below

The Calculus way to do this problem.

we have P = 2x + 2y = 8 ............P is the perimeter

and we want the area A = xy to be a maximum

from P, we have

2x + 2y = 8

=> x = 4 - y ..........solved for x

=> A = xy = (4 - y)y = 4y - y^2

for max area, we want A' = 0

=> A' = 4 - 2y = 0

=> 4 - 2y = 0

=>y = 2

but x = 4 - y

=> x = 4 - 2

=>x = 2

so for our rectangle, x = y = 2, so we want a 2 x 2 rectangle

The Precalculus way to do this problem

we have P = 2x + 2y = 8 ............P is the perimeter

and we want the area A = xy to be a maximum

from P, we have

2x + 2y = 8

=> x = 4 - y ..........solved for x

=> A = xy = (4 - y)y = 4y - y^2

For max A, we want the vertex of the parabola 4y - y^2 = 0

vertex occurs when y = -b/2a

=> we want y = -4/2(-1) = -4/-2 = 2

soy = 2

but x = 4 - y

=> x = 4 - 2

=>x = 2

so for our rectangle, x = y = 2, so we want a 2 x 2 rectangle

got it?