To calculate the x-axis location of the center of mass of a group of objects, calculate the sum of the products of the object's masses and their individual x-center-of-mass locations, and divide by the sum of the masses.
$$X_{cm} = \frac{(m_1*X_{cm1} + m_2*X_{cm2} +...)}{(m_1+m_2+...)} $$
Referring to the left side of this figure, you can see the x-center-of-mass locations of various components (tanks, engines, payload).
So with some totally made up numbers here is a sample calculation using the equation above for this unfueled rocket.
For the time-varying tank liquid masses, the same approach is used. (Refer to the right side of the diagram) Assuming the tank is totally full at liftoff, the cm's of the tank and fluid will be be the same. You can calculate the liquid mass at any time using the known flow rate of propellants to the engines. Then the cm of the fluid and the cm of the tank go into the equation as two separate components.
This is terribly simplified, ignores pressurization gas and probably a hundred other things, but my goal was to show you the basic procedure and you can build on it to make it as complex as you like.