How to group by on two fields and count
SELECT users, COUNT(*) FROM (
    SELECT
    `user1` AS users
    FROM usuarios
    WHERE (`user1` is not null)
    UNION ALL
    SELECT
    `user2`
    FROM usuarios
    WHERE (`user2` is not null)
) sq 
GROUP BY users;


Do the grouping outside. The trick is to use UNION ALL instead of UNION. The latter one uses a distinct on the result. You don't have to include the id column in the subqueries, so you can later count it, because it's the primary key and doesn't allow null values anyway.