How many master-detail relationships per object?

There is only 2 Master Detail Relationship allowed per object and it can have upto three custom detail levels.
You can read more about it here, Considerations for Relationships


Each object is allowed to have one or two masters, or up to 8 details.


You can have a Total of 40 Relationship fields with a Maximum of 2 Master Detail Relationships. So you can have all 40 as Lookup Relationship fields, 38 Lookup and 2 MD 39 Lookup and 1 MD relationship fields on an object.