The Rectangle tool allows you to draw rectangular shapes (vector and pixel-based) and paths (shape outlines).
Photoshop Rectangle Tool
  1. Select the Rectangle tool (U) .

  2. Use the Options bar to customize tool settings, like Fill, Stroke, Width, and Height, to get the effect you want.

  3. Draw shapes or paths on the canvas.

    • Draw a rectangle: Drag diagonally in any direction. 
    • Draw a square: Hold down the Shift key and then drag diagonally in any direction.
    • Draw from the center out: Position the crosshairs where you want the center of the shape or the path to be, hold down Alt (Windows) or Option (macOS), and then drag diagonally to any corner.