What happens with three matching tiles in a row in 2048?

On this pageAn exampleFour in a row

Only one pair merges. The two tiles nearest the side you slide toward combine, and the third stays beside the new tile.

When three equal tiles sit together, only two of them merge. The pair closest to the side you are sliding toward combines, and the third tile slides up behind the new one.

An example

A row of 2, 2, 2 and an empty cell, slid left, becomes 4, 2. Slid right, the same row becomes 2, 4, because the pair nearest the right edge merges this time.

Four in a row

Four equal tiles make two pairs. Slid in either direction, 2, 2, 2, 2 becomes 4, 4, and it takes a further move to merge those two into an 8.

That is why the direction you pick decides which tiles combine, and why keeping your big tiles on one edge helps (the corner method). For the basics see how tiles merge and the full rules.