Photon Cannon rush
From Liquipedia Starcraft 2 Wiki
A Cannon Rush is a Protoss Cheese that entails warping in Photon Cannons in or near an opponent's base. It can be used as an all-in, a feint, or a contain. It can be especially effective in lower level/league play. The strategy relies heavily on surprise and the incorrect response of an opponent, though it can be difficult or impossible to recover if it fails.
The main goal of the Photon Cannon rush is to quickly place Photon Cannons in range of the opponent's production buildings or mineral lines. This forces them to either initiate a potentially costly counter-attack or accept the loss of key structures or workers.
 Basic Build Order
Some variations of the cannon rush dictate that the attacking player save up several hundred minerals and place several Pylons at once to create a wall to protect the cannons.
Scouting a cannon rush should be relatively easy if the scouting unit is sent early enough. A Protoss player engaging in a typical cannon rush will only have a single Pylon and single Forge in their main; an indicator to a player that they should immediately begin scouting their own main and surrounding area.
In general, a Photon Cannon rush consists of a Probe placing a hidden Pylon just outside the enemy's vision, and building additional Pylons and Photon Cannons closer and closer to the enemy's buildings and mineral line.
Deciding when to send the first Probe is important, above all else the success of a cannon rush depends on the element of surprise, and as such, any strange play early on may tip off the opponent that a cannon rush is imminent. It's generally recommended that a player send their first Probe after building the 9 Pylon, early enough to scout the opponent without tipping them off that a cannon rush is imminent.
Once a player discovers the location of their opponent, a Forge should be immediately built. Ideally, the initial Probe should go unseen and construct the first Pylon outside of the opponent's vision. If the opponent discovers this initial Probe, it may be beneficial to attempt to build the first Pylon in a location where cannons would have a greater effect, such as behind the mineral line.
Regardless of placement, the initial Pylon should be started before the Forge finishes to allow for the earliest possible rush. Once the Pylon finishes, the Forge should be complete, and the attacking player can begin building cannons. If the rush is yet undetected, the initial cannon should be placed near the initial Pylon to defend it; otherwise the cannon should be placed to optimally engage defending forces. No cannons should be allowed to be destroyed while constructing, any that are near death should be canceled to recoup 75% of the mineral cost of construction.
The success of a cannon rush depends greatly on the response of the opponent, often players will be caught off guard and either respond too harshly by sending all workers to attack the initial Pylon; or they respond too lightly, often by only sending one worker to attack the Probe building cannons.
A typical adaptation of the cannon rush is to use Pylons to completely wall off cannons behind the mineral line. The idea is to make it impossible for the defending player to attack the cannons with workers or melee units, while being able to completely deny mining in the main. The strategy works best on maps that have locations in the main that can be completely walled off using 3 or fewer Pylons.
In this adaptation, it's recommended that the attacking player save up 300 to 400 minerals to be able to build the blocking Pylons in quick succession, followed by the cannons inside the wall once these initial Pylons complete. It's best to build the first Pylon in the location with the smallest gap. At least one open hex should be left behind each Pylon so they can be quickly rebuilt if they are destroyed by melee units, which would otherwise prevent the Pylons from being rebuild in the same location.
It's even possible on certain maps to form a complete wall off using only two Pylons.
- Scouting is the most important aspect of countering a cannon rush; scouting both in base and the opponent's base.
- If a player sees a Protoss opponent who has gone Forge first and has only a single Pylon in their main, the player should immediately begin scouting their own base for a Pylon.
- Regularly check inside your base until you have units guarding your ramp. This can be done with buildings (and Overlord) placement around the base.
 Protoss Counters
The only way to effectively defend a cannon rush as Protoss is to scout the attempted attack in time. Once scouted, the defending player should immediately build their own Forge and immediately start building cannons in between the buildings in the base. The aim is to use defensive cannons to attack and destroy the attacking player's cannons. It's recommended that the defending player maintains parity or exceeds by one the number of cannons the attacking player has built. The defending player may also use probes to attack the offensive cannons of the opponent.  The defending player should be able to ultimately destroy all the cannons of the attacking player.
 Terran Counters
Terran have an advantage in dealing with Cannon rushes as Marines are excellent at taking out Probes constructing Pylons. Marines are especially useful if the opponent has walled themselves in behind the mineral line with Pylons, as Marines can easily pick off Probes in such a scenario. Terran can also Lift off and move production buildings that may be in range of the cannons. Terran may also Lift off their initial Command Center and move it to the natural, while continuing to produce Marines to destroy Probes.
- Note: It takes two Marines or three SCVs to destroy a cannon which is being built.
 Zerg Counters
As with all three match ups, scouting is key. If the Zerg player see's a Forge first, they should immediately move a Drone to the bottom of their ramp to scout for Probe attempting to block it with cannons. A Drone can be used to prevent the Protoss player from completely walling in the ramp.
Creep will usually prevent the Protoss player from being able to place many cannons within range of the Hatchery, and usually a few Spine Crawlers along with Queens can be used to defend against the cannon rush until Zerg has sufficient units to stop the attack or send a counterattack.
- Note: Four Zerglings are needed to kill a Cannon while it is building.
- Cannon rushes can be particularly effective on maps such as Daybreak LE, where cannons can be completely walled in behind the mineral line in the main with just two Pylons. 
- Cannon rushing also works well on maps with small ramps that can be walled off.