As a general rule, must the cg of a tandem ultralight be greater than 25% mean aerodynamic chord?
you want the cg always behind the Cp (25% MAC) of the wing, but in front of the plane's neutral point, as you want the tail to provide an offsetting tail up force


Yes, that is correct. The cg should be between the forward wing's quarter point and the common neutral point (NP) of both wings. However, if you want some agility when maneuvering the plane, it should be much closer to the neutral point. If both wings are of equal size, you definitely want the rear wing to contribute some lift. Since it flies in the downwash of the forward wing, it will see a smaller change in effective angle of attack and have a smaller lift curve slope, which already supplies some stall margin by helping to let the forward wing stall first. By shifting the cg a bit forward of the NP (10% to 25% of MAC should be sufficient), you will reduce lift on the rear wing further and increase stability.


  I understand the centre of pressure of a classic wing is at it's quarter point.


Only if the wing has a symmetric or reflex airfoil. With regular cambered airfoils the cp is further aft and moves forward to the quarter point with increasing angle of attack.