This is not a Dracaena marginata. Identification is by the stem. Marginata's have a series of rings on the stem whereas Yucca's have a russeted bark. Also D. marginata usually has a red margin on the outside edge of the leaves which are thin unlike the leaves of the Yucca which are thicker. This plant is Yucca elephantipes, a native of Central America. Outside it is quite happy to grow up to 30 M tall ( ~90' feet), inside it is considerably smaller. Most interior specimens get to 2 M ( ~6') or so although I have seen a few at ten or twenty feet if the ceiling allows.
The usual suspect in cases of poor health is over watering and insufficient light which seems to be the case here. The usual soil less mix based on peat keeps the roots too wet and root rot is common. These plants need high light, a free draining soil and a light hand on the water. Another typical maintenance problem with soil less mixes is that they cannot provide support for a tall heavy plant so they lean or tip in the pot.
The plant in the picture has been over watered and the large stems are dead. It is regrowing from the roots but it will take a long time to become anything attractive. You can cut the stems down to the base with a saw as they are unlikely to regrow.
A better resolution would be to move to a higher light area, go easy on the water and avoid the use of soil less peat based mixes which are too moist in low light conditions.