Subscripts are vauge and have many different meanings and uses. Please trust me and do not use them in Mathematica code until you know more about how Mathematica works and so you can understand how they work. Many newer Mathematica programmers want to use them and it doesn't go well.
Math notation is very often not a good way to think about programming.
Are you looking to use tensor notation? There are packages for that you can find online, but they aren't exactly simple. You might be able to write code that looks like this with them, but I wouldn't suggest it unless you were a seasoned Mathematica programmer.
You could write your code like this:
x[1, 1] = 1;
x[1, 2] = 2;
x[2, 1] = 3;
x[2, 2] = 4;
Sum[x[i, j], {i, 1, 2}, {j, 1, 2}]
Or like
x[1, 1] = 1;
x[1, 2] = 2;
x[2, 1] = 3;
x[2, 2] = 4;
ivalues = {1, 2};
jvalues = {1, 2};
Sum[x[i, j], {i, ivalues}, {j, jvalues}]
But I think either of these is still a bit akward.