Rank-2 toric code in two dimensions