Bring a large pot of water with onion, lemon, celery, bay leaves, and peppercorns to a boil. Season with salt.
Add shrimp to the boiling water. Cook for 2 minutes or until ready. Shrimp are ready when they are opaque, have turned pink (if using pink shrimp the color will just be brighter), float up to the top, and or curled into a C-shape. Be careful not to overcook the shrimp.
As soon as the shrimp are cooked, remove them from the boiling water using a slotted spoon. Transfer the cooked shrimp to an ice bath or a bowl filled with ice water to stop the cooking process.
If using shrimp with shells, remove the shells after cooking.
Notes
If using shrimp with shells on, cook the shrimp with shells intact and remove them after cooking. This will impart extra flavor.
I prefer to use cleaned, deveined, and peeled shrimp for convenience. Trader Joe's carries wild Red Argentine shrimp that I like to keep in my freezer for when quick and easy dinner nights.
If using frozen shrimp, thaw it completely before boiling.