Aircraft: ROBINSON R22
Phase of flight: Taxi
Anomaly: ATC Issue All Types; Conflict NMAC

What happened: Aircraft Y was given a take off clearance for a runway that was occupied by a helicopter that had landed on the opposite end and was awaiting taxi instructions.What led to this: The helicopter was coming in from the east and requested to land on the western side of the airport. The active runways at the time were south to north (XXL and XXR). The Tower cleared the helicopter to land on the numbers of an inactive runway XY; which would keep the helicopter on the eastern side of the airport; away from the flow of fixed wing traffic. About 5 minutes elapsed between the time the helicopter landed and Aircraft Y flew over the helicopter.During that time I believe the Controller may have been distracted by pattern traffic; Aircraft Z arrival (this was a factor prior to the helicopter landing which resulted in the controller deciding to keep the helicopter on the eastern side of the airport); a change in Aircraft Y IFR clearance; and by a pilot of an airplane who mistakenly made a final approach to the wrong parallel runway.Starting from the point at which the helicopter lands; the following exchanges were heard.Aircraft A was cleared for touch and go #2 behind Aircraft Z for runway XXL.Aircraft B was cleared to Land runway XXR.A few seconds after Aircraft B acknowledged the landing clearance the tower issue a taxi instruction to the airborne Aircraft B 'hold short of runway XXR I am going to have a departure off runway XZ.'Aircraft B responded 'I am in the air.'The tower replied 'Disregard; Land and hold short of runway XZ; land and hold short of runway XZ.'Aircraft B responded that this was their intention and would be parking in an area that would not put them at risk of crossing into runway XZ.The tower approved a request to taxi back to parking after Aircraft B completed a 180 degree turn on the runway after landing.30 seconds later the tower controller said to Aircraft B; 'Disregard the land and hold short clearance. I won't have that departure. He will be holding in place; though.'The tower instructed Aircraft Y to line up and wait on runway XZ.The 737 had already landed on XXL and the tower cleared a Cessna for takeoff runway XXL.20 seconds later Aircraft B realized he was about to land on top of Aircraft A who had just been cleared for takeoff and asked the tower if he should go around. There was no response. Aircraft B hailed the tower again. I observed Aircraft B descend below 100 ft AGL before deciding to go around. 40 seconds elapsed between the 1st and 3rd time Aircraft B called the tower.The tower gave the departing Aircraft A; a mixed up call starting with 'line up and- cancel take off- cleared for takeoff runway XXL'The tower then gave Aircraft B instructions to remain in the upwind; he would give him a crosswind instruction to follow.Aircraft B apologized for lining up to land on the wrong runway.As soon as the frequency congestion allowed; knowing there was a jet on the opposite side of my runway; I made a call 'Tower; Helicopter (call-sign) holding position on the numbers of [Runway] XY ready to taxi to (name of ramp)'. The call was not acknowledged and 55 seconds later an amended departure clearance; combined with a takeoff clearance; was given to the waiting Aircraft Y. I did not hear the departure clearance and Aircraft Y began racing towards us. Ironically; I may have turned to my student and said to keep an eye on Aircraft Y. As it rushed overhead I made an aggressive maneuver off of the numbers and onto the closest available vacant spot beyond the runway safety area.Previous experiences at this airport have made it clear when a helicopter accepts a landing clearance to a spot; taxiway; intersection; or helipad; they are expected to remain there until given a clearance to taxi. Quite often the controllers will vector an arriving helicopter far around the approach or departure center lines of the active runways and restrict them to altitudes below 600 MSL instead of accommodating a flight path crossing the active runways at a higher safe altitude. Less often are we allowed to land as in the case above in a place safely away from the departing/arriving aircraft; and in a position where we can easily air taxi at a moment's notice. A helicopter is highly maneuverable and this aspect should be used to the utmost advantage when minimizing delays to arriving or departing airplanes. As mentioned earlier the helicopter's arrival was prior to Aircraft Z checking in with the tower. There was Aircraft A on a half-mile final to runway XXL ahead of Aircraft Z. With several miles of spacing between Aircraft Z and Aircraft A; the tower began to ask the helicopter to pass behind the landing Aircraft A. We accepted. The tower immediately reversed their decision due to Aircraft Z scheduled arrival and cleared us to land on the numbers of [Runway] XY with the restriction 'remain north of XX'. We accepted the clearance to land. It is very likely that a helicopter crossing the approach end of XXL shortly after the landing Aircraft A would have had little to no effect on any of the other present arriving or departing aircraft. Helicopter pilot reported that after landing; another aircraft was cleared for takeoff from the opposite end of the same runway; resulting in the helicopter taking evasive action. Pilot reported that several other aircraft and confusing ATC radio communications were part of the overall situation.