(Reuters) - Recreational marijuana is on track to be legalized in Canada by July 2018, making Canada the first Group of Seven country to allow the drug nationwide and the second in the world after Uruguay. While the federal legislation proposed by Prime Minister Justin Trudeau s Liberal government will regulate cannabis production, the details of who can sell it and who can buy it will be largely left up to the country s provinces. The following are details of some key factors of how legal marijuana is shaping up in Canada.  So far, five of Canada s 10 provinces have come forward with frameworks for retail marijuana sale. In Ontario, Quebec and New Brunswick, cannabis sales will be run by provincial government-owned entities. The western provinces of Manitoba and Alberta have said they will license private retailers.  The federal government set the minimum legal age for buying marijuana at 18, but the provinces can raise that if they wish. In Ontario, Canada s most populous province, the legal age will be 19. The federal government s proposed law also permits adults to grow up to four marijuana plants at home, although Quebec announced Thursday it will not allow residents of the province to grow their own marijuana.  Federal and provincial governments are tightening the rules around impaired driving and bringing in a roadside saliva test to check for drug impairment. The federal government is setting up systems to track all cannabis from seed to sale, to license non-medical producers and to test marijuana for potency and quality control. The federal government has already issued more than 70 licenses for producing medical marijuana, which has been legal in Canada since 2001. MJIC Inc s equal-weighted Canadian Marijuana Index, which tracks stocks of major legal cannabis companies, is up 28 percent this year. The Horizons Marijuana Life Sciences ETF, the first exchange traded fund in North America to focus on the legal market, is up more than 20 percent since it launched in April. Canopy Growth Corp, Aurora Cannabis and Aphria, three of Canada s four biggest marijuana producers by market cap, have gained 89 percent, 137 percent and 71 percent respectively this year. MedReleaf Corp, the fourth, which listed in June, is up 107 percent since its debut.  Marijuana stocks listed have surged since Oct. 30, when U.S. alcohol company Constellation Brands bought a nearly 10 percent stake in Canopy for about C$245 million ($192.05 million). A battle is brewing between the federal government and some provinces over how tax revenue is divided between the two levels of government. The federal government said last week it wants an excise tax on all cannabis products of C$1 (78 cents) per gram (0.04 ounce), or 10 percent of the retail price, whichever is higher.  The government proposed splitting the tax 50-50 with the provinces, drawing criticism from Ontario which says it will face higher costs related to enforcement and establishing a system for sales.  ($1 = 1.2757 Canadian dollars) 
Factbox - Pot Nation: Canada's plans for legal marijuana