The International Date Line mainly follows longitude 180 degrees, but deviates from it in order to separate land masses (Asia and North America), and to keep island groups together in the same time zone.

In the north, it runs through the Bering Strait in order to separate Russia, to the west, from Alaska to the east, and then to ensure the Aleutian Islands remain in one group.

Further south, in the mid Pacific, the date line deviates again, crossing the equator and then turning east and almost reaching longitude 150 degrees before turning north, crossing the equator for the second time, and then turning east again before going south, once more crossing the equator, and then south west until it regains longitude 180 degrees. This ensures Kiribati and other groups remain together.

More Info: en.m.wikipedia.org