I know how they got Rome and the majority of the other parts of Italy, just not sure how they got Rome.
From what I heard, they got it through an alliance with Prussia, but I don't know how Prussia got Venice. I might be wrong on this though.
Edit: I meant to say Venice. I was reading this study guide and I typed Rome. Dammit dammit dammit.
What you're looking for is the Third Italian War of Independence, an "under-war" of the Austro-Prussian War over the dominance in Germany.
The Italians had originally joined the Prussians because they were promised an opportunity to capture the last major Italian area that was still under the control of Austria for their newly founded Kingdom of Italy. However, the new Kingdom still had major teething problems, the army and navy were made up of men and material from the various formerly-independent countries in the Italian region, who had enjoyed longstanding rivalries and wars with each other over the last decades and as such were rather belligerent and hostile towards each other.
As such, the performance of the Italians was rather poorly, losing a battle with numerical advantage against the troops of Archduke Albrecht (oldest son of Archduke Charles, the first general to beat an army under the command of Napoleon back in 1809) only 4 days after their declaration and only slowly gaining some traction as Austria was forced to move more and more troops back to Vienna to defend against the ever-advancing Prussians. And with the clearly superior Italian Navy surprisingly suffering a humiliating and decisive defeat at Lissa against the Austrian Nelson, Admiral Wilhelm von Tegetthoff, that part didn't go all too well either. So when the Prussians finally signed an armistice Italy was quick to follow lest the Austrian Army was returning down south.
Though part of Prussia's demands was that Venice be given to Italy, so that worked out for them after all. Except that Austria was not willing to hand Venice to someone who had performed so poorly in their eyes, so instead of Italy the lands were given to France, using Napoleon III. as a mediator, with the expectation that France would gift them to Italy after "consulting the local population on their wishes". The Italians weren't exactly thrilled getting their rightful lands at the grace of another nation but they didn't say no either and signed the Treaty of Vienna on the 23^rd of August 1866.
[...] just not sure how they got Rome
In 1860, with the Risorgimento in full swing, many in the territories belonging to the Papal States revolted and formed the United Provinces of Central Italy - Piedmontese troops then moved in support of the rebellion and defeated the Papal army at the battle of Castelfidardo but Napoleon III didn't allow them to capture Latium and with that, Rome.
The United Provinces were then annexed by means of a plebiscite.
The P.S. soon found themselves encroached on three sides by Italy, and were left in control of most of what is today's Latium. A French garrison guaranteed the States' inviolability and sovereignty but the Italian government never ceased to consider Rome as the country's sole rightful capital; in 1865, it was moved to Florence in order to put pressure on both France and the Pope. In 1867 Garibaldi led an ill-fated expedition which was stopped short at Mentana (near the border) by Italian troops, as the government feared that it would lead to a war with France.
By 1870, however, things had changed - France was now too busy fighting a war on its own soil and had to recall its garrison; the Italians took advantage of this break in order to assault Rome and capture it on September 20.
The city was officially declared Capital of the new Kingdom on 3 February, 1871.
To expand this a little:
What made Venice "Italian"? What caused them to be Italian but others nearby not?
To further detail what has already been said, during the cessation process Veneto was presented with a farcical plebiscite. It read:
We declare our union to the Kingdom of Italy under the constitutional monarchical government of King Vittorio Emanuele II and his successors
The choices were "yes" or "no". The results showed that 641,757 people voted "yes". 366 spoiled their ballots. Votes for "no"— 69.
Source: Gigi di Fiore, Controstoria dell'unità d'italia: fatti e misfatti del Risogimento (Milano: Rizzoli, 2007), 321.