The actual answer will depend on what language you are using, but a very crude approach to this in Python would be something like the code below. Note that there are many ways to actually do this, some of which are a little hard to understand if you are a new programmer, so this is a "brute force" approach that should be fairly clear as far as the logic goes:
matrix = [[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1], [0, 0, 0, 0]]
longest_row_count = 0
longest_row_index = 0
for i, row in enumerate(matrix):
counter = 0
for index in row:
if index:
counter += 1
if counter > longest_row_count:
longest_row_index = i
longest_row_count = counter
print(f'The most True/1s were in index {longest_row_index}. It had {longest_row_count}')
By the way, adding this for if you want a more advanced solution (very Python-specific):
matrix = [[0, 1, 1, 1], [0, 0, 1, 1], [1, 1, 1, 1], [0, 0, 0, 0]]
counts = []
for row in matrix:
counts.append(row.count(1))
print(f'The most True/1s were in index {counts.index(max(counts))}. It had {max(counts)}')