The formula is:
Perimeter = (the distance all the way around the outside of the figure) .
How to calculate the distance all the way around the outside of the figure
is different for every shape.
A few of them are:
Square . . . . . 4 x the length of one side
Rectangle . . . . . (2) x (length + width)
Circle . . . . . (2 pi) x (radius)
etc.