Lee's father was a Colonel in the British army, and started his son off in a military career early. He was sent to a military academy in Switzerland during his formative years, and then in 1746, Lee became an ensign in his father's regiment.
Lee was sent to the colonies in 1755 to fight in the French and Indian War. He served under Edward Braddock and then later at Fort Ticonderoga, where he was injured in the fighting. Lee recovered, and later fought at Fort Niagara. I'd always thought there were a lot of Fort fights fought. He finished his time in the colonies with the British conquest of Montreal.
Lee returned to England in 1760, possibly because he was seeking career advancement. He was named a Major in 1761 and was sent to fight the Spanish in Portugal. Though his service record there was good, Lee didn't receive praise on his return home - in fact, he was retired from the army at half-pay. After that, Lee became a vocal critic of military higher-ups, and the British Prime Minister - and found that his military career had (inexplicably!) completely stalled.
Frustrated with his lack of advancement with the British, Lee moved back to New York in 1773. He quickly became a supporter of the revolutionary cause and in June of 1775 he joined the Continental Army with the rank of Major General.
Lee began his service under the command of George Washington - which grated, since Lee had some hopes of being named Commander-in-Chief of the army himself. Given Lee's experience he might have had a point, but he also had his drawbacks. Most notable was his temper - Lee was quick to anger, and had a habit of being very vocally and publicly angry when he didn't get his way. Bosses LOVE that.
Lee also had some rather odd personal quirks. He was exceptionally fond of dogs, and was continually surrounded by them, in particular his much-loved Pomeranian. Never trust a man continually surrounded by tiny dogs. He was also vain and liked tailored suits, but rarely washed them, meaning that he smelled little better than his animals (and worse, according to some.)
Despite his failings, Lee was both a competent leader and popular with the troops. Washington recognized it, and named one of the forts on the Hudson River "Fort Lee", in his honour. If Washington was hoping that just naming a fort after him smooth over their rocky relationship, it amazingly didn't work.
In fact, as time went on, Lee became less and less fond of Washington, and became reluctant to follow his orders at all. When Washington retreated across New York and New Jersey in 1776, he sent several commands to Lee to follow him, which Lee did, but very slowly. Which may be what resulted in him being left behind and captured by the British in 1776. Still. It's understandable. He probably had to stop every five minutes to let his bloody dogs piss in a hedge.
Fortunately for Lee, he'd resigned his commission in the British army shortly after taking on his role in the Continental Army. That meant instead of being tried for being a deserter, his imprisonment in New York was more of an inconvenience. He was wined and dined by the British, allowed to have whomever he wanted as a dinner guest. It was basically a bed and breakfast. In return, Lee gave up information about the state of the Continental Army.
When Lee was finally released from New York, he was convinced that the Continental Army couldn't hold its own against the British, and told Congress so. However, when Washington decided to go ahead with plans to attack the British column at Monmouth, Lee insisted on being in charge.
Once the battle began, Lee ordered his soldiers to retreat - modern historians are still debating the reasons why. Maybe he'd forgotten his doggie treats in the tent and needed to go and get them. Washington swept in and took command, turning a complete rout of his army into a draw, and Lee received a very thorough and public dressing down. Afterward, Lee demanded an apology or a court-martial to clear his name.
Washington chose the court-martial, which didn't go as Lee had hoped. He was found guilty of "misbehaviour before the enemy, making a shameful and disorderly retreat, and disrespect to the commander-in-chief". He was only given a year's suspension for the crimes, but by the time the year was over, he'd been so vocal in his criticism of Washington that Congress removed him from the army permanently.
Lee retired to his estate in Virginia, passing his time breeding more dogs. After his death, he was given a full military funeral - getting all the respect he craved, too late to do anything with it.