To block a rug to square:
You need a floor that you can put small holes in. building one with plywood is pretty easy.
Start by laying out straight lines with 90 degree corners to make a rectangle the size you want the rug to be. Use pencil, chalk line, string or straightedges to lay out guidelines.
Fasten a corner and then stretch one side to match your outline. Fasten that second corner and that entire side to match your guideline.
From the original corner and stretch the end to your guideline. Fasten that third corner and entire end to your guideline.
Stretch the last corner to the last guideline corner. You will have one side and one end that have a bow that will need to be stretched to the guideline.
Starting in the middle of the unattached end, stretch to the guideline. Pick a point halfway between the corner and the middle and stretch to the guideline. Continue to halve the distance between fasteners until the entire end is straight. Repeat this procedure with the unattached side.
If there are puckers between fasteners, stretch the carpet and put in more fasteners in those spots.
Get the rug warm and wet - just cleaning with a wand works well.
Minor irregularities between fasteners will look OK once the carpet is dry and fasteners removed.
A needlepoint can be blocked face up, thicker carpets need to be blocked face down.