Let me draw a diagram to clarify exactly what we are talking about. We have two (or more) clocks that start at the same point in spacetime $S$ and end at the same point in spacetime $T$. So if we draw a diagram to show how the clocks moved through spacetime it might look something like this:

And we want to compare how many ticks each of the clocks recorded so we can find out which clock recorded the most ticks. Then your tick rate is just the number of ticks the clock recorded in moving from $S$ to $T$.
The algebra involved in this can get a little complicated, but the basic principle is surprisingly simple. To explain it let's start with a slightly different situation. Suppose $A$ and $B$ are two people walking on a field and the diagram shows their position on the field as $(x,y)$ coordinates. Now change the question to:
Which person recorded the fewest steps walking from $S$ to $T$?
The answer is obviously $B$ because the number of steps is proportional to the distance and $B$ walked in a straight line while $A$ walked in a curve. We know the shortest distance between two points is a straight line, so we know $B$ walked the shortest distance so we know $B$ recorded the fewest steps, and this is always true no matter what curve $A$ walked in.
The same applies to objects moving in spacetime with one key difference. In relativity we calculate the length of a line in a different way from Euclidean geometry and as a result of this our basic principle changes to:
The longest distance between two points in spacetime is a straight line
This may seem a bit odd, but the fact the longest distance is the straight line is behind all the weird effects in relativity like time dilation and length contraction.
Anyhow, in our spacetime diagram $B$ moves in a straight line while $A$ moves in a curve so $B$ measures the longest distance. It turns out that the length of the line is just the time recorded by a clock that moves along that line. So we can immediately say that $B$ measured more ticks on their clock than $A$ did. And just as in my example of the people walking in a field this is always true no matter what weird curve $A$ moves in. So our conclusion is:
The observer who moves in a straight line through spacetime measures the most ticks on their clock
It only remains to define what moving in a straight line means in relativity and actually it means the same as in Newtonian mechanics. In Newtonian mechanics an object moves in a straight line through space if its acceleration is zero, and in relativity an object moves in a straight line in spacetime if its four-acceleration ¹ is zero.
In special relativity (things get more complicated in general relativity) a stationary object is obviously not accelerating, so in your example where $B$ is stationary it is moving in a straight line (in fact it is moving straight up the time axis at one second per second). By contrast $A$ is accelerating so it cannot be moving in a straight line. So from our argument above we can be confident that $B$ always measures more time on their clock than $A$ does, no matter exactly how $A$ moves ².
This is of course the twin paradox, and what I have described above is how it is resolved. A more detailed description of this is given in What is the proper way to explain the twin paradox? though the maths in that are probably a bit too hard for people just starting to learn relativity.
¹ Describing exactly what the four-acceleration is can get a little involved, but a useful simplification is that your four-acceleration is zero if you feel no g-forces. So an observer floating weightless in space has a zero four-acceleration while an observer being shaken about inside a rocket has a non-zero four-acceleration.
² This is not true if $A$ is allowed to move faster than light, but then all sorts of strange things happen if we allow faster than light travel.